Cscott has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/57690


Change subject: Move <a>/<i> nesting tests from Parsoid's whitelist into 
upstream.
......................................................................

Move <a>/<i> nesting tests from Parsoid's whitelist into upstream.

Parsoid nests <a> and <i> tags differently than the PHP parser.

Change-Id: Iee3539565ee29322a3e6f1e4d088ba382bfdb568
---
M tests/parser/parserTests.txt
1 file changed, 54 insertions(+), 3 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core 
refs/changes/90/57690/1

diff --git a/tests/parser/parserTests.txt b/tests/parser/parserTests.txt
index eb11453..c8538a1 100644
--- a/tests/parser/parserTests.txt
+++ b/tests/parser/parserTests.txt
@@ -2854,7 +2854,9 @@
 !! end
 
 !! test
-Bug 2702: Mismatched <i>, <b> and <a> tags are invalid
+Bug 2702: Mismatched <i>, <b> and <a> tags are invalid (php)
+!! options
+php
 !! input
 ''[http://example.com text'']
 [http://example.com '''text]'''
@@ -2867,6 +2869,27 @@
 <i>Something </i><a rel="nofollow" class="external text" 
href="http://example.com";><i>in italic</i></a>
 <i>Something </i><a rel="nofollow" class="external text" 
href="http://example.com";><i>mixed</i><b>, even bold</b></a>
 <i><b>Now </b></i><a rel="nofollow" class="external text" 
href="http://example.com";><i><b>both</b></i></a>
+</p>
+!! end
+# Italic/link nesting is changed in this test, but the rendered result is the
+# same. Currently the parsoid result is actually an improvement over the
+# PHP output (although the <a> is broken into two pieces in the mixed example)
+!! test
+Bug 2702: Mismatched <i>, <b> and <a> tags are invalid (parsoid)
+!! options
+parsoid
+!! input
+''[http://example.com text'']
+[http://example.com '''text]'''
+''Something [http://example.com in italic'']
+''Something [http://example.com mixed''''', even bold]'''
+'''''Now [http://example.com both''''']
+!! result
+<p><i><a href="http://example.com";>text</a></i>
+<a href="http://example.com";><b>text</b></a>
+<i>Something <a href="http://example.com";>in italic</a></i>
+<i>Something <a href="http://example.com";>mixed</a></i><a 
href="http://example.com";><b>, even bold</b></a>
+<i><b>Now <a href="http://example.com";>both</a></b></i>
 </p>
 !! end
 
@@ -2966,11 +2989,24 @@
 !! end
 
 !! test
-External link containing double-single-quotes in text embedded in italics (bug 
4598 sanity check)
+External link containing double-single-quotes in text embedded in italics (bug 
4598 sanity check) (php)
+!! options
+php
 !! input
 ''Some [http://example.com/ pretty ''italics'' and stuff]!''
 !! result
 <p><i>Some </i><a rel="nofollow" class="external text" 
href="http://example.com/";><i>pretty </i>italics<i> and stuff</i></a><i>!</i>
+</p>
+!! end
+# parsoid nests the <i> and <a> differently.
+!! test
+External link containing double-single-quotes in text embedded in italics (bug 
4598 sanity check) (parsoid)
+!! options
+parsoid
+!! input
+''Some [http://example.com/ pretty ''italics'' and stuff]!''
+!! result
+<p><i>Some <a href="http://example.com/";>pretty </a></i><a 
href="http://example.com/";>italics<i> and stuff</i></a><i>!</i>
 </p>
 !! end
 
@@ -3952,14 +3988,29 @@
 </p>
 !! end
 
+# The Parsoid team notes that the expected result for the PHP parser
+# is broken html (<i> nested inside <i>).
 !! test
-Link containing double-single-quotes '' in text embedded in italics (bug 4598 
sanity check)
+Link containing double-single-quotes '' in text embedded in italics (bug 4598 
sanity check) (php)
+!! options
+php
 !! input
 ''Some [[Link|pretty ''italics'' and stuff]]!
 !! result
 <p><i>Some <a href="/index.php?title=Link&amp;action=edit&amp;redlink=1" 
class="new" title="Link (page does not exist)">pretty <i>italics</i> and 
stuff</a>!</i>
 </p>
 !! end
+# parsoid output for this test case (valid html!)
+!! test
+Link containing double-single-quotes '' in text embedded in italics (bug 4598 
sanity check) (parsoid)
+!! options
+parsoid
+!! input
+''Some [[Link|pretty ''italics'' and stuff]]!
+!! result
+<p><i>Some <a href="/index.php?title=Link&amp;action=edit&amp;redlink=1" 
class="new" title="Link (page does not exist)">pretty </a></i><a 
href="/index.php?title=Link&amp;action=edit&amp;redlink=1" class="new" 
title="Link (page does not exist)">italics<i> and stuff</i></a><i>!</i>
+</p>
+!! end
 
 !! test
 Link with double quotes in title part (literal) and alternate part 
(interpreted)

-- 
To view, visit https://gerrit.wikimedia.org/r/57690
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: Iee3539565ee29322a3e6f1e4d088ba382bfdb568
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: Cscott <wikime...@cscott.net>

_______________________________________________
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to