Last modified: 2012-09-23 14:23:25 UTC

Wikimedia Bugzilla is closed!

Wikimedia migrated from Bugzilla to Phabricator. Bug reports are handled in Wikimedia Phabricator.
This static website is read-only and for historical purposes. It is not possible to log in and except for displaying bug reports and their history, links might be broken. See T31349, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 29349 - MediaWiki 1.16.5 does not produce valid XHTML
MediaWiki 1.16.5 does not produce valid XHTML
Status: RESOLVED INVALID
Product: MediaWiki
Classification: Unclassified
Parser (Other open bugs)
1.16.x
PC All
: Lowest normal (vote)
: ---
Assigned To: Nobody - You can work on this!
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2011-06-11 15:35 UTC by hods9000-289
Modified: 2012-09-23 14:23 UTC (History)
3 users (show)

See Also:
Web browser: ---
Mobile Platform: ---
Assignee Huggle Beta Tester: ---


Attachments

Description hods9000-289 2011-06-11 15:35:45 UTC
MediaWiki 1.15.3 was XHTML 1.0 Transitional and had no errors.

MediaWiki 1.16.5 now uses XHTML 1.0 Strict. Why? It doesn't validate. It has 11 errors.
Comment 1 Bawolff (Brian Wolff) 2011-06-11 19:22:07 UTC
Because it's in html5 mode (And html5 apparently allows you to have XHTML doc type, well still being an html5 document - see r59741. Basically this tricks an XML parser into thinking its valid XML, well still being valid HTML5 at the same time). If you validate it is html5 it should have less errors and still be conforming (I think anyways).

In any case if you really don't like it, you can put one of the following two things in LocalSettings.php :

$wgWellFormedXml = false;

This would make it output <!doctype html> instead of xhtml strict, which the validator might choke on less (however, both should be technically equally valid i think). However, this could break bots that want to think the document is xml, due to undefined entities. Probably not an issue unless you use things like pyWikipediaBot (I think) which parse pages as XML

Alternatively you can do:

$wgHtml5 = false;

Which will turn off html5 mode (and thus it will stop using some html5 features), and restore the previous doctype (transitional by default, but configurable in LocalSettings.php)

In 1.17, we stop outputting html entities, which makes the xml well-formedness thingy less of an issue, so we just output <!doctype html> all the time, which makes this a non-issue. ($wgWellFormedXml still controls if we use some html5 features that are invalid in xml, but starting 1.17 the html5 doctype is always used when in html5 mode regardless of what $wgWellFormedXml is)

Thus I can't imagine we're going to change anything as the issue goes away on 1.17, so I'm going to close this invalid. (but feel free to re-open if you don't think i should close it)
Comment 2 hods9000-289 2012-04-13 13:10:03 UTC
(In reply to comment #1)
> Because it's in html5 mode (And html5 apparently allows you to have XHTML doc
> type, well still being an html5 document - see r59741. Basically this tricks an
> XML parser into thinking its valid XML, well still being valid HTML5 at the
> same time). If you validate it is html5 it should have less errors and still be
> conforming (I think anyways).
> 
> In any case if you really don't like it, you can put one of the following two
> things in LocalSettings.php :
> 
> $wgWellFormedXml = false;
> 
> This would make it output <!doctype html> instead of xhtml strict, which the
> validator might choke on less (however, both should be technically equally
> valid i think). However, this could break bots that want to think the document
> is xml, due to undefined entities. Probably not an issue unless you use things
> like pyWikipediaBot (I think) which parse pages as XML
> 
> Alternatively you can do:
> 
> $wgHtml5 = false;
> 
> Which will turn off html5 mode (and thus it will stop using some html5
> features), and restore the previous doctype (transitional by default, but
> configurable in LocalSettings.php)
> 
> In 1.17, we stop outputting html entities, which makes the xml well-formedness
> thingy less of an issue, so we just output <!doctype html> all the time, which
> makes this a non-issue. ($wgWellFormedXml still controls if we use some html5
> features that are invalid in xml, but starting 1.17 the html5 doctype is always
> used when in html5 mode regardless of what $wgWellFormedXml is)
> 
> Thus I can't imagine we're going to change anything as the issue goes away on
> 1.17, so I'm going to close this invalid. (but feel free to re-open if you
> don't think i should close it)

Hi, I tried using both pieces of code you gave me but neither worked.
Comment 3 Daniel Friesen 2012-09-23 14:23:25 UTC
I'm going to just INVALID this. It's months old. We output HTML5 with <!DOCTYPE html>. And 1.16 is obsolete.

Note You need to log in before you can comment on or make changes to this bug.


Navigation
Links