jenkins-bot has submitted this change and it was merged. ( https://gerrit.wikimedia.org/r/327286 )
Change subject: Sync parserTests with core. ...................................................................... Sync parserTests with core. Change-Id: I4bc976d3a861052b201ad985aac0a647999d2cc4 --- M tests/parserTests-blacklist.js M tests/parserTests.txt M tools/fetch-parserTests.txt.js 3 files changed, 57 insertions(+), 17 deletions(-) Approvals: jenkins-bot: Verified Arlolra: Looks good to me, approved diff --git a/tests/parserTests-blacklist.js b/tests/parserTests-blacklist.js index 4571014..6b4288b 100644 --- a/tests/parserTests-blacklist.js +++ b/tests/parserTests-blacklist.js @@ -645,7 +645,6 @@ add("html2wt", "Templates: Indent-Pre: 1f: Wrapping should be based on expanded content", " a\n\n\n\n a\n\n\n\n b\n\na\n\n b\n\na\n\n b\n"); add("html2wt", "Templates: Strip leading and trailing whitespace from named-param values", "a\n\nb\n\nc\n\n* d\n"); add("html2wt", "Templates: Don't strip whitespace from positional-param values", "a \n\nb \n\n c \n\n\n\n d\n\n\n\n e\n\n\n\n* f\n\n\n g\n"); -add("html2wt", "Templates: Handle empty comment-and-ws-only lines correctly", "foo\nbar\n"); add("html2wt", "Templates: Handle comments in the target", "{{echo <!-- should be ignored -->|foo}}\n\n{{echo <!-- should be ignored and spaces on next line should not trip us up (T147742) -->|foo}}\n\n{{echo<!-- should be ignored -->|foo}}\n\n{{echo<!-- should be ignored -->|foo}}\n\n{{echo|foo}}"); add("html2wt", "Templates: Handle comments in parameter names (bug 67657)", "{{echo|1 <!-- should be ignored -->=foo}}\n\n{{echo|<!-- should be ignored --> 1=foo}}\n\n{{echo|1<!-- should be ignored -->=foo}}\n\n{{echo|<!-- should be ignored -->1=foo}}"); add("html2wt", "1a. Indent-Pre and Comments", " a\n\nc\n"); diff --git a/tests/parserTests.txt b/tests/parserTests.txt index 47401bc..07d50a8 100644 --- a/tests/parserTests.txt +++ b/tests/parserTests.txt @@ -1,5 +1,5 @@ # MediaWiki Parser test cases -# Some taken from http://meta.wikimedia.org/wiki/Parser_testing +# Some taken from https://meta.wikimedia.org/wiki/Parser_testing # All (C) their respective authors and released under the GPL # # The syntax should be fairly self-explanatory. @@ -539,7 +539,7 @@ !! end # Note that the html+tidy output removes the spaces after the <li>, -# which is a bug (http://sourceforge.net/p/tidy/bugs/945/, etc). +# which is a bug (https://sourceforge.net/p/tidy/bugs/945/, etc). # This is an issue for all tests with lists. We intentionally do # *not* add html+tidy clauses for these, as we don't want to # document/test the broken behavior. (Parsoid matches the non-tidy @@ -1245,7 +1245,7 @@ !! end # test cases taken from -# http://www.w3.org/TR/html5/text-level-semantics.html#the-ruby-element +# https://www.w3.org/TR/html5/text-level-semantics.html#the-ruby-element !! test Ruby markup (W3C-style) !! wikitext @@ -1308,7 +1308,7 @@ </p> !! end -# There is a tidy bug here: http://sourceforge.net/p/tidy/bugs/946/ +# There is a tidy bug here: https://sourceforge.net/p/tidy/bugs/946/ # If the non-word-character tag made it through the sanitizer, tidy # would munge it up. !! test @@ -1433,6 +1433,15 @@ :and a colon </span></p> +!! end + +!! test +Don't parse <nowiki><span class="error"></nowiki> (T149622) +!! wikitext +<nowiki><span class="error"></nowiki> +!! html/php +<p><span class="error"> +</p> !! end !! test @@ -2718,10 +2727,12 @@ <!--should be ignored--> <!--should be ignored as well--> bar}} -!! html +!! html/php <p>foo bar </p> +!! html/parsoid +<p typeof="mw:Transclusion" data-mw='{"parts":[{"template":{"target":{"wt":"echo","href":"./Template:Echo"},"params":{"1":{"wt":"foo\n<!--should be ignored-->\n <!--should be ignored as well-->\nbar"}},"i":0}}]}'>foo <!--should be ignored--> <!--should be ignored as well--> bar</p> !! end !! test @@ -2741,7 +2752,14 @@ {{echo<!-- should be ignored -->|foo}} {{<!-- should be ignored -->echo|foo}} -!!html/parsoid +!! html/php +<p>foo +</p><p>foo +</p><p>foo +</p><p>foo +</p><p>foo +</p> +!! html/parsoid <p typeof="mw:Transclusion" data-mw='{"parts":[{"template":{"target":{"wt":"echo\n<!-- should be ignored -->\n","href":"./Template:Echo"},"params":{"1":{"wt":"foo"}},"i":0}}]}'>foo</p> <p typeof="mw:Transclusion" data-mw='{"parts":[{"template":{"target":{"wt":"echo\n<!-- should be ignored and spaces on next line should not trip us up (T147742) -->\n ","href":"./Template:Echo"},"params":{"1":{"wt":"foo"}},"i":0}}]}'>foo</p> @@ -2767,7 +2785,13 @@ {{echo|1<!-- should be ignored -->=foo}} {{echo|<!-- should be ignored -->1=foo}} -!!html/parsoid +!! html/php +<p>foo +</p><p>foo +</p><p>foo +</p><p>foo +</p> +!! html/parsoid <p typeof="mw:Transclusion" data-mw='{"parts":[{"template":{"target":{"wt":"echo","href":"./Template:Echo"},"params":{"1":{"wt":"foo","key":{"wt":"1\n<!-- should be ignored -->"}}},"i":0}}]}'>foo</p> <p typeof="mw:Transclusion" data-mw='{"parts":[{"template":{"target":{"wt":"echo","href":"./Template:Echo"},"params":{"1":{"wt":"foo","key":{"wt":"<!-- should be ignored -->\n1"}}},"i":0}}]}'>foo</p> @@ -2781,11 +2805,11 @@ Templates: Other wikitext in parameter names (bug 67657) !! wikitext {{echo|''1''=foo}} -!!html/parsoid -<p typeof="mw:Transclusion" data-mw='{"parts":[{"template":{"target":{"wt":"echo","href":"./Template:Echo"},"params":{"''1''":{"wt":"foo"}},"i":0}}]}'>{{{1}}}</p> -!!html/php +!! html/php <p>{{{1}}} </p> +!! html/parsoid +<p typeof="mw:Transclusion" data-mw='{"parts":[{"template":{"target":{"wt":"echo","href":"./Template:Echo"},"params":{"''1''":{"wt":"foo"}},"i":0}}]}'>{{{1}}}</p> !!end #-------------------------------------------------------------------- @@ -3860,7 +3884,7 @@ ## All Parsoid only definition list tests have this difference. ## ## See also: https://phabricator.wikimedia.org/T8569 -## and http://lists.wikimedia.org/pipermail/wikitext-l/2011-November/000483.html +## and https://lists.wikimedia.org/pipermail/wikitext-l/2011-November/000483.html !! test Table / list interaction: indented table with lists in table contents @@ -5214,7 +5238,7 @@ <p><a rel="mw:ExtLink" href="http://www.example.com/?title=AT%26T">http://www.example.com/?title=AT%26T</a></p> !! end -# According to http://www.w3.org/TR/2011/WD-html5-20110525/Overview.html#parsing-urls a plain +# According to https://www.w3.org/TR/2011/WD-html5-20110525/Overview.html#parsing-urls a plain # % is actually legal in HTML5. Any change in output would need testing though. !! test Bug 4781, 5267: %25 in URL @@ -5801,7 +5825,7 @@ # This should not produce <table></table> as <table><tr><td></td></tr></table> # is the bare minimum required by the spec, see: -# http://www.w3.org/TR/xhtml-modularization/dtd_module_defs.html#a_module_Basic_Tables +# https://www.w3.org/TR/xhtml-modularization/dtd_module_defs.html#a_module_Basic_Tables # Parsoid team replies: empty table tags are legal in HTML5 !! test A table with no data. @@ -7435,6 +7459,23 @@ </p> !! html/parsoid <p>[[Thomas Bek (bishop of St David's)|]]</p> +!! end + +!! test +Piped link with empty link text +!! wikitext +[[Main Page|<nowiki />]] - empty nowiki +[[Main Page| ]] - empty space +[[Main Page| ]] - empty non breaking space +!! html/php +<p><a href="/wiki/Main_Page" title="Main Page"></a> - empty nowiki +<a href="/wiki/Main_Page" title="Main Page"> </a> - empty space +<a href="/wiki/Main_Page" title="Main Page"> </a> - empty non breaking space +</p> +!! html/parsoid +<p><a rel="mw:WikiLink" href="./Main_Page" title="Main Page"><meta typeof="mw:Placeholder" data-parsoid='{"src":"<nowiki />"}'/></a> - empty nowiki +<a rel="mw:WikiLink" href="./Main_Page" title="Main Page"> </a> - empty space +<a rel="mw:WikiLink" href="./Main_Page" title="Main Page"><span typeof="mw:Entity" data-parsoid='{"src":"&nbsp;","srcContent":" "}'> </span></a> - empty non breaking space</p> !! end !! test @@ -19398,7 +19439,7 @@ <p><span typeof="mw:Entity">î</span><span typeof="mw:Entity">î</span></p> !! end -# See: http://www.w3.org/TR/html5/syntax.html#character-references +# See: https://www.w3.org/TR/html5/syntax.html#character-references # Note that U+000C (form feed) is not a valid XML character, so # it is banned even though allowed in HTML5. !! test diff --git a/tools/fetch-parserTests.txt.js b/tools/fetch-parserTests.txt.js index c83e93f..ebca303 100755 --- a/tools/fetch-parserTests.txt.js +++ b/tools/fetch-parserTests.txt.js @@ -12,9 +12,9 @@ // and update these hashes automatically. // // You can use 'sha1sum -b tests/parser/parserTests.txt' to compute this value: -var expectedSHA1 = "77a7c7f8432fc30c3f2979e9d7a46a0c8aae2b5d"; +var expectedSHA1 = "e83c0ae1b38a89ef8f9451402828e036ec1a9dde"; // git log --pretty=oneline -1 tests/parser/parserTests.txt -var latestCommit = "c2d29bf3738182f147b01ef2b526ed79fbbe6d7b"; +var latestCommit = "caebba387a00802a6c8fdc0f53fec3cbab244be0"; var fs = require('fs'); var path = require('path'); -- To view, visit https://gerrit.wikimedia.org/r/327286 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: I4bc976d3a861052b201ad985aac0a647999d2cc4 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/services/parsoid Gerrit-Branch: master Gerrit-Owner: C. Scott Ananian <canan...@wikimedia.org> Gerrit-Reviewer: Arlolra <abrea...@wikimedia.org> Gerrit-Reviewer: Legoktm <lego...@member.fsf.org> Gerrit-Reviewer: Subramanya Sastry <ssas...@wikimedia.org> Gerrit-Reviewer: jenkins-bot <> _______________________________________________ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits