Subramanya Sastry has uploaded a new change for review.
https://gerrit.wikimedia.org/r/180785
Change subject: Fix a bunch of broken wikitext escaping tests
......................................................................
Fix a bunch of broken wikitext escaping tests
* These have been broken since 75dc37bf.
* The HTML for these tests should NOT have mw:nowiki spans since
we are testing whether escapable text in the HTML gets serialized
with <nowiki> in wikitext!
* Exposed a failing wikitext test.
Change-Id: If712ddf6433f559348bce75c5f2e108b45e900ee
---
M tests/parserTests-blacklist.js
M tests/parserTests.txt
2 files changed, 20 insertions(+), 16 deletions(-)
git pull ssh://gerrit.wikimedia.org:29418/mediawiki/services/parsoid
refs/changes/85/180785/1
diff --git a/tests/parserTests-blacklist.js b/tests/parserTests-blacklist.js
index f2214e0..15abf5a 100644
--- a/tests/parserTests-blacklist.js
+++ b/tests/parserTests-blacklist.js
@@ -1750,6 +1750,7 @@
add("html2wt", "Lists: 2. Inside definition lists", ";
<nowiki>;foo</nowiki>\n\n; <nowiki>:foo</nowiki>\n\n; <nowiki>:foo</nowiki>\n:
bar\n\n: <nowiki>:foo</nowiki>\n");
add("html2wt", "Lists: 3. Only bullets at start of text should be escaped", "*
<nowiki>*foo*bar</nowiki>\n\n* <nowiki>*foo</nowiki>''it''*bar\n");
add("html2wt", "Lists: 4. No escapes needed", "* foo*bar\n\n* ''foo''*bar\n\n*
[[Foo]]: bar\n\n* [[Foo]]*bar\n");
+add("html2wt", "HRs: 1. Single line", "--------\n----=foo=\n----*foo\n");
add("html2wt", "Links 13: Protect link-like plain text. (Parsoid bug T78425)",
"this is not a link: http://example.com\n");
add("html2wt", "1. Leading whitespace in SOL context should be escaped",
"<nowiki> </nowiki>a\n\n<nowiki> </nowiki> a\n\n\ta(tab)\n\n
\ta\n\n<!--cmt--><nowiki> </nowiki> a\n\na\n<nowiki>
</nowiki>b\n\na\n\tb\n\na\n\t b\n");
add("html2wt", "3. Leading whitespace in indent-pre suppressing contexts
should not be escaped", "<blockquote>\n\n a\n <span>b</span>\n
c\n</blockquote>");
diff --git a/tests/parserTests.txt b/tests/parserTests.txt
index 8023e3c..5e68bc8 100644
--- a/tests/parserTests.txt
+++ b/tests/parserTests.txt
@@ -19914,7 +19914,7 @@
!! wikitext
= ='''bold'''<nowiki>foo=</nowiki> =
!! html
-<h1>=<b>bold</b><span typeof="mw:Nowiki">foo=</span></h1>
+<h1>=<b>bold</b>foo=</h1>
!!end
!! test
@@ -19936,7 +19936,7 @@
= ''=''foo= =
-= <nowiki>=</nowiki> =
+= = =
!! html
<h1>=foo</h1>
<h1>foo=</h1>
@@ -19945,7 +19945,7 @@
<h2>=foo</h2>
<h2>foo=</h2>
<h1><i>=</i>foo=</h1>
-<h1><span typeof="mw:Nowiki">=</span></h1>
+<h1>=</h1>
!!end
!! test
@@ -20219,11 +20219,11 @@
!! test
Lists: 6. Escape bullets in SOL position
!! options
-parsoid
+parsoid=html2wt
!! wikitext
-<!--cmt--><nowiki>*foo</nowiki>
+<!--cmt--><nowiki>*</nowiki>foo
!! html
-<p><!--cmt--><span typeof="mw:Nowiki">*foo</span></p>
+<p><!--cmt-->*foo</p>
!!end
!! test
@@ -20254,13 +20254,13 @@
!! test
HRs: 1. Single line
!! options
-parsoid
+parsoid=html2wt
!! wikitext
----<nowiki>----</nowiki>
----=foo=
----*foo
!! html
-<hr><p><span typeof="mw:Nowiki">----</span></p>
+<hr><p>----</p>
<hr><p>=foo=</p>
<hr><p>*foo</p>
!! end
@@ -20342,16 +20342,19 @@
!! test
Tables: 2b. Nested in td
!! options
-parsoid
+parsoid=html2wt
!! wikitext
{|
|<nowiki>foo||bar</nowiki>
-|''it''<nowiki>foo||bar</nowiki>
+|a''<nowiki>b||c</nowiki>''
+|a''<div><nowiki>b||c</nowiki></div>''
|}
!! html
<table><tbody><tr>
-<td><span typeof="mw:Nowiki">foo||bar</span></td>
-<td><i>it</i><span typeof="mw:Nowiki">foo||bar</span></td></tr></tbody></table>
+<td>foo||bar</td>
+<td>a<i>b||c</i></td>
+<td>a<i><div>b||c</div></i></td>
+</tr></tbody></table>
!! end
!! test
@@ -20419,7 +20422,7 @@
!! test
Tables: 4a. Escape -
!! options
-parsoid
+parsoid=html2wt
!! wikitext
{|
!-bar
@@ -20430,13 +20433,13 @@
<table><tbody>
<tr><th>-bar</th></tr>
<tr>
-<td><span typeof="mw:Nowiki">-bar</span></td></tr></tbody></table>
+<td>-bar</td></tr></tbody></table>
!! end
!! test
Tables: 4b. Escape +
!! options
-parsoid
+parsoid=html2wt
!! wikitext
{|
!+bar
@@ -20447,7 +20450,7 @@
<table><tbody>
<tr><th>+bar</th></tr>
<tr>
-<td><span typeof="mw:Nowiki">+bar</span></td></tr></tbody></table>
+<td>+bar</td></tr></tbody></table>
!! end
!! test
--
To view, visit https://gerrit.wikimedia.org/r/180785
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: If712ddf6433f559348bce75c5f2e108b45e900ee
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/services/parsoid
Gerrit-Branch: master
Gerrit-Owner: Subramanya Sastry <[email protected]>
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits