Last modified: 2013-06-08 14:21:35 UTC
escapeId() is currently stripping the ', " and & characters. Is that really necessary? They are apparently allowed in HTML5 as well as in fragments (RFC 3987) and don't cause any known problems other than that they must be escaped in the HTML source. But that applies to all attributes, not just IDs.
http://www.mediawiki.org/wiki/Manual:$wgExperimentalHtmlIds
Sanitizer.php comment: * To ensure we don't have to bother escaping anything, we also strip ', ", * & even if $wgExperimentalIds is true. TODO: Is this the best tactic? * We also strip # because it upsets IE, and % because it could be * ambiguous if it's part of something that looks like a percent escape * (which don't work reliably in fragments cross-browser). I did this to keep things simple. There are probably places in the code where someone outputs IDs without escaping on the theory that they can't contain special characters, and people will probably continue to assume that in the future even if we audit all existing uses. Developers are not going to expect id's to contain special characters. So I think this should be WONTFIX.