Last modified: 2012-12-21 19:41:31 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 T33871, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 31871 - Fix usage of tidy to work cleanly with html5
Fix usage of tidy to work cleanly with html5
Status: REOPENED
Product: MediaWiki
Classification: Unclassified
Parser (Other open bugs)
1.20.x
All All
: Normal normal (vote)
: ---
Assigned To: Nobody - You can work on this!
:
: 39525 (view as bug list)
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2011-10-22 00:25 UTC by DaSch
Modified: 2012-12-21 19:41 UTC (History)
5 users (show)

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


Attachments

Description DaSch 2011-10-22 00:25:05 UTC
When a headline begins with a number this is put as id to the headline element as it is. Because XHTML does not allow the id of an elemente to start with a number this leads to a XHTML error/warning. I think this behaviour should be changed. For example by generaly prepending something to the id or onlay to headings with numbers.

BTW: What happens if two headings have the same name? This would also lead to a XHTML Error.
Comment 1 Daniel Friesen 2011-10-22 00:44:16 UTC
Ids with a leading number are valid in html5. Archaic XHTML rules don't really matter here as MediaWiki now uses html5.

For the record MediaWiki never actually used XHTML. It used a XHTML doctype, but XHTML served with text/html is not XHTML and is not parsed as XHTML, in such a situation what a validator says is irrelevant.


When two headings have the same name the later id="" has an underscore and incrementing numeral added to it.
Comment 2 DaSch 2011-10-22 00:54:19 UTC
Well, when mediawiki uses HTML5 then Tidy should know this and I should not have this in my page

line 77 column 38 - Warning: <span> attribute "id" has invalid value "12._Oktober_2011"
line 80 column 38 - Warning: <span> attribute "id" has invalid value "11._Oktober_2011"
line 83 column 39 - Warning: <span> attribute "id" has invalid value "10._Oktober_2011"
line 86 column 39 - Warning: <span> attribute "id" has invalid value "08._Oktober_2011"
line 89 column 39 - Warning: <span> attribute "id" has invalid value "06._Oktober_2011"
line 92 column 39 - Warning: <span> attribute "id" has invalid value "03._Oktober_2011"
Comment 3 Daniel Friesen 2011-10-22 01:25:23 UTC
Guess that's related to the output-xhtml=yes setting in tidy.conf. I expect that was done so that tidy would output valid xml because we still haven't stopped outputting the well-formed xml format of markup.

We'll need to see if changing the tidy settings causes any unwanted bugs or side effects.

The tidy settings that html5-rack-tidy uses look interesting:
https://github.com/customink/html5-rack-tidy/blob/master/lib/rack/tidy/cleaner.rb

We may have a use for some of those settings. Maybe if necessary we could use separate tidy.conf and tidy5.conf files.
Comment 4 Derk-Jan Hartman 2012-08-01 11:05:06 UTC
W3C recently seems to have taken over Tidy and is working on HTML5 compatible version of it. 

https://github.com/w3c/tidy-html5/
Comment 5 Andre Klapper 2012-12-21 17:31:20 UTC
*** Bug 39525 has been marked as a duplicate of this bug. ***

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


Navigation
Links