Followup to r86061: add parser test case to confirm that '&apos' in wikitext doesn...
authorBrion Vibber <brion@users.mediawiki.org>
Tue, 7 Jun 2011 20:11:24 +0000 (20:11 +0000)
committerBrion Vibber <brion@users.mediawiki.org>
Tue, 7 Jun 2011 20:11:24 +0000 (20:11 +0000)
'&apos;' is not defined in HTML 4, and some browsers (for instance IE at least through 8) do not support it.
It is however part of XML 1 (and thus XHTML 1), and is also defined in HTML 5 provisional, so it's fine to accept it.

Normalization seems to already handle turning the &apos; named char reference into &#39; so we don't have any compatibility worries.

Also added a comment on the def in Sanitizer that it shouldn't be used in output.

includes/Sanitizer.php
tests/parser/parserTests.txt

index 113a85e..e56783f 100644 (file)
@@ -64,7 +64,7 @@ class Sanitizer {
                'amp'      => 38,
                'and'      => 8743,
                'ang'      => 8736,
-               'apos'     => 39,
+               'apos'     => 39, // New in XHTML & HTML 5; avoid in output for compatibility with IE.
                'Aring'    => 197,
                'aring'    => 229,
                'asymp'    => 8776,
index 492d646..b2b4980 100644 (file)
@@ -9212,6 +9212,16 @@ Special characters in embedded file links (bug 27679)
 !! end
 
 
+!! test
+Confirm that 'apos' named character reference doesn't make it to output (not legal in HTML 4)
+!! input
+Text&apos;s been normalized?
+!! result
+<p>Text&#39;s been normalized?
+</p>
+!! end
+
+
 TODO:
 more images
 more tables