aboutsummaryrefslogtreecommitdiffstats
path: root/tests/parser
diff options
context:
space:
mode:
authorC. Scott Ananian <cscott@cscott.net>2020-04-02 11:17:41 -0400
committerC. Scott Ananian <cscott@cscott.net>2020-05-27 11:59:18 -0400
commit05bc6871115911abf227226ac623fce72e97e6b5 (patch)
treea237878b115e41d04a136d222e7fdcc89f91bcc1 /tests/parser
parent7097484a2147b5b6c8942d66710835d00875c3c0 (diff)
downloadmediawikicore-05bc6871115911abf227226ac623fce72e97e6b5.tar.gz
mediawikicore-05bc6871115911abf227226ac623fce72e97e6b5.zip
Use HTML5 semantics for self-closed HTML tags in wikitext
This behavior has been deprecated and with a tracking category since 1.28. Time to remove the temporary parameter added to Sanitizer::removeHTMLtags() and (finally) tweak the behavior to match HTML5. Bug: T134423 Change-Id: I5c725175d05854139c95a2b3d8d35ff63cb6707b
Diffstat (limited to 'tests/parser')
-rw-r--r--tests/parser/parserTests.txt32
1 files changed, 11 insertions, 21 deletions
diff --git a/tests/parser/parserTests.txt b/tests/parser/parserTests.txt
index f8461763492d..10220d3e0bb9 100644
--- a/tests/parser/parserTests.txt
+++ b/tests/parser/parserTests.txt
@@ -9710,8 +9710,8 @@ Failing to transform badly formed HTML into correct XHTML
</p>
!!end
-## FIXME: Is Parsoid's acceptance of self-closing html-tags
-## a feature or a bug? See https://phabricator.wikimedia.org/T76962
+## Parsoid's behavior w/ self-closing HTML tags is now a bug;
+## see T134423. Legacy Parser now implements proper HTML5 semantics.
!! test
Handling html with a div self-closing tag
!! wikitext
@@ -9721,20 +9721,13 @@ Handling html with a div self-closing tag
<div title=bar />
<div title=bar/>
<div title=bar/ >
-!! html/php+tidy
-<div title=""></div>
-<div title=""></div>
+!! html+tidy
<div title="">
-<div title="bar"></div>
-<div title="bar"></div>
-<div title="bar/"></div></div>
-!! html/parsoid
-<div title="" data-parsoid='{"stx":"html","selfClose":true}'></div>
-<div title="" data-parsoid='{"stx":"html","selfClose":true}'></div>
-<div title="" data-parsoid='{"stx":"html","autoInsertedEnd":true}'>
-<div title="bar" data-parsoid='{"stx":"html","selfClose":true}'></div>
-<div title="bar" data-parsoid='{"stx":"html","selfClose":true}'></div>
-<div title="bar/" data-parsoid='{"stx":"html","autoInsertedEnd":true}'></div></div>
+<div title="">
+<div title="">
+<div title="bar">
+<div title="bar">
+<div title="bar/"></div></div></div></div></div></div>
!! end
!! test
@@ -19753,8 +19746,7 @@ Self closed html pairs (T7487)
<center><font id="bug" />Centered text</center>
<div><font id="bug2" />In div text</div>
!! html+tidy
-<center><font id="bug"></font>Centered text</center>
-<div><font id="bug2"></font>In div text</div>
+<center><font id="bug">Centered text</font></center><font id="bug"><div><font id="bug2">In div text</font></div></font>
!! end
!! test
@@ -28220,10 +28212,8 @@ Self-closed tag with broken attribute value quoting
parsoid=wt2html,html2html
!! wikitext
<div title="Hello world />Foo
-!! html/php+tidy
-<div title="Hello world"></div><p>Foo</p>
-!! html/parsoid
-<div title="Hello world " data-parsoid='{"stx":"html","selfClose":true}'></div><p>Foo</p>
+!! html+tidy
+<div title="Hello world">Foo</div>
!! end
!! test