r89681 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r89680‎ | r89681 | r89682 >
Date:20:11, 7 June 2011
Author:brion
Status:ok
Tags:
Comment:
Followup to r86061: add parser test case to confirm that '&apos' in wikitext doesn't make it to output.

''' 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 ' named char reference into ' 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.
Modified paths:
  • /trunk/phase3/includes/Sanitizer.php (modified) (history)
  • /trunk/phase3/tests/parser/parserTests.txt (modified) (history)

Diff [purge]

Index: trunk/phase3/tests/parser/parserTests.txt
@@ -9212,6 +9212,16 @@
92139213 !! end
92149214
92159215
 9216+!! test
 9217+Confirm that 'apos' named character reference doesn't make it to output (not legal in HTML 4)
 9218+!! input
 9219+Text's been normalized?
 9220+!! result
 9221+<p>Text&#39;s been normalized?
 9222+</p>
 9223+!! end
 9224+
 9225+
92169226 TODO:
92179227 more images
92189228 more tables
Index: trunk/phase3/includes/Sanitizer.php
@@ -64,7 +64,7 @@
6565 'amp' => 38,
6666 'and' => 8743,
6767 'ang' => 8736,
68 - 'apos' => 39,
 68+ 'apos' => 39, // New in XHTML & HTML 5; avoid in output for compatibility with IE.
6969 'Aring' => 197,
7070 'aring' => 229,
7171 'asymp' => 8776,

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r45387Add special case handling of the XHTML character entity "&apos;" to normalize...vyznev02:29, 4 January 2009
r86061Allow people to use &apos; entity (sinqle quote character: ') in wikitext....bawolff17:42, 14 April 2011

Status & tagging log