Cscott has uploaded a new change for review.
https://gerrit.wikimedia.org/r/74542
Change subject: Sync up with upstream parserTests.
......................................................................
Sync up with upstream parserTests.
We have one new html2wt failure on the blacklist, but note that it fits
right in with all the other 'External image' html2wt failures. Basically
Parsoid needs the rel="mw:ExtLink" to know whether to serialize links with
[[ ]] brackets or not.
Change-Id: I9293a50cd8d74f34eee52b1004311e21aeda4399
---
M js/tests/fetch-parserTests.txt.js
M js/tests/parserTests-blacklist.js
M js/tests/parserTests.txt
3 files changed, 95 insertions(+), 30 deletions(-)
git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Parsoid
refs/changes/42/74542/1
diff --git a/js/tests/fetch-parserTests.txt.js
b/js/tests/fetch-parserTests.txt.js
index 4193b69..1f92ba5 100755
--- a/js/tests/fetch-parserTests.txt.js
+++ b/js/tests/fetch-parserTests.txt.js
@@ -10,9 +10,9 @@
// and update these hashes automatically.
//
// You can use 'sha1sum -b tests/parser/parserTests.txt' to compute this value:
-var expectedSHA1 = "a6c0e0455b33825626c062b23c4ffcc6c4efa42d";
+var expectedSHA1 = "dbf294faadb0fca67f9a267e6864d40909581788";
// git log --pretty=oneline -1 tests/parser/parserTests.txt
-var latestCommit = "06fb69d943c3b1e0ac7137156f15792aee68f448";
+var latestCommit = "cd9ad736027025a784499807668da50865ec18eb";
var fs = require('fs'),
path = require('path'),
diff --git a/js/tests/parserTests-blacklist.js
b/js/tests/parserTests-blacklist.js
index 7dcd3ee..3132334 100644
--- a/js/tests/parserTests-blacklist.js
+++ b/js/tests/parserTests-blacklist.js
@@ -1337,6 +1337,7 @@
add("html2wt", "External links: protocol-relative URL in brackets without
text");
add("html2wt", "External image");
add("html2wt", "External image from https");
+add("html2wt", "External image (when not allowed)");
add("html2wt", "Link to non-http image, no img tag");
add("html2wt", "External links: terminating separator");
add("html2wt", "External links: intervening separator");
diff --git a/js/tests/parserTests.txt b/js/tests/parserTests.txt
index 242f742..e1f2370 100644
--- a/js/tests/parserTests.txt
+++ b/js/tests/parserTests.txt
@@ -27,6 +27,10 @@
# comment run through Linker::formatComment() instead of main parser
# local format section links in edit comment text as local links
#
+# You can also set the following parser properties via test options:
+# wgEnableUploads, wgAllowExternalImages, wgMaxTocLevel,
+# wgLinkHolderBatchSize, wgRawHtml
+#
# For testing purposes, temporary articles can created:
# !!article / NAMESPACE:TITLE / !!text / ARTICLE TEXT / !!endarticle
# where '/' denotes a newline.
@@ -1106,7 +1110,7 @@
!! end
###
-### paragraph wraping tests
+### paragraph wrapping tests
###
!! test
No block tags
@@ -2753,6 +2757,17 @@
External image from https: https://meta.wikimedia.org/upload/f/f1/Ncwikicol.png
!! result
<p>External image from https: <img
src="https://meta.wikimedia.org/upload/f/f1/Ncwikicol.png" alt="Ncwikicol.png"
/>
+</p>
+!! end
+
+!! test
+External image (when not allowed)
+!! options
+wgAllowExternalImages=0
+!! input
+External image: http://meta.wikimedia.org/upload/f/f1/Ncwikicol.png
+!! result
+<p>External image: <a rel="nofollow" class="external free"
href="http://meta.wikimedia.org/upload/f/f1/Ncwikicol.png">http://meta.wikimedia.org/upload/f/f1/Ncwikicol.png</a>
</p>
!! end
@@ -9524,6 +9539,81 @@
###
+### Nesting tests (see bug 41545, 50604, 51081)
+###
+
+# This test case is fixed in Parsoid by domino 1.0.12. (bug 50604)
+# Note that html2wt is considerably more difficult if we use <b> in
+# the test case, instead of <big>
+!! test
+Ensure that HTML adoption agency algorithm is properly implemented.
+!! input
+<big>X<big>Y</big>Z</big>
+!! result
+<p><big>X<big>Y</big>Z</big>
+</p>
+!! end
+
+# This was bug 41545 in the PHP parser.
+!! test
+Nesting of <kbd>
+!! input
+<kbd>X<kbd>Y</kbd>Z</kbd>
+!! result
+<p><kbd>X<kbd>Y</kbd>Z</kbd>
+</p>
+!! end
+
+# The following cases were bug 51081 in the PHP parser.
+# Note that there are some other nestable tags (b, i, etc) which are
+# not covered; see bug 51081 for discussion.
+!! test
+Nesting of <em>
+!! input
+<em>X<em>Y</em>Z</em>
+!! result
+<p><em>X<em>Y</em>Z</em>
+</p>
+!! end
+
+!! test
+Nesting of <strong>
+!! input
+<strong>X<strong>Y</strong>Z</strong>
+!! result
+<p><strong>X<strong>Y</strong>Z</strong>
+</p>
+!! end
+
+!! test
+Nesting of <q>
+!! input
+<q>X<q>Y</q>Z</q>
+!! result
+<p><q>X<q>Y</q>Z</q>
+</p>
+!! end
+
+!! test
+Nesting of <ruby>
+!! input
+<ruby>X<ruby>Y</ruby>Z</ruby>
+!! result
+<p><ruby>X<ruby>Y</ruby>Z</ruby>
+</p>
+!! end
+
+!! test
+Nesting of <bdo>
+!! input
+<bdo>X<bdo>Y</bdo>Z</bdo>
+!! result
+<p><bdo>X<bdo>Y</bdo>Z</bdo>
+</p>
+!! end
+
+
+###
### Media links
###
@@ -12258,7 +12348,7 @@
!! test
HTML with raw HTML ($wgRawHtml==true)
!! options
-rawhtml
+wgRawHtml=1
!! input
<html><script>alert(1);</script></html>
!! result
@@ -16195,32 +16285,6 @@
# End of section for Parsoid-only html2wt tests for serialization
# of new content
# -----------------------------------------------------------------
-
-# This test case is fixed by domino 1.0.12.
-# Note that html2wt is considerably more difficult if we use <b> in
-# the test case, instead of <big>
-!! test
-Ensure that HTML adoption agency algorithm is properly implemented.
-!! options
-!! input
-<big>X<big>Y</big>Z</big>
-!! result
-<p><big>X<big>Y</big>Z</big>
-</p>
-!! end
-
-# The parsoid team believes the below behavior of the PHP parser to be
-# a bug.
-!! test
-Document PHP parser behavior for HTML adoption agency test case.
-!! options
-php
-!! input
-<em>X<em>Y</em>Z</em>
-!! result
-<p><em>X<em>Y</em>Z</em>
-</p>
-!! end
TODO:
more images
--
To view, visit https://gerrit.wikimedia.org/r/74542
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I9293a50cd8d74f34eee52b1004311e21aeda4399
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Parsoid
Gerrit-Branch: master
Gerrit-Owner: Cscott <[email protected]>
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits