Arlolra has uploaded a new change for review.

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


Change subject: Fix inconsistency in expected fails with --html2wt
......................................................................

Fix inconsistency in expected fails with --html2wt

An unexpected fail was occurring when the --html2wt flag alone was
present.

The patch,

 * Reorders the modes to run html2wt before html2html

 * Removes two unused variables in WikitextSerializer

 * Updates the blacklist to include the now failing test

The difference comes from running convertWt2Html(). It invokes
this.env.switchToConfig() with the prefix "is", after which the test
passes. Maybe the environment language should be set as defined in the test
before html2wt as well because the output is correct when it is.

Bug: 52046
Change-Id: Ia918539cf97a15b441e64e4a5b9d6dcd5a1ad783
---
M js/lib/mediawiki.WikitextSerializer.js
M js/tests/parserTests-blacklist.js
M js/tests/parserTests.js
3 files changed, 4 insertions(+), 4 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Parsoid 
refs/changes/15/77915/1

diff --git a/js/lib/mediawiki.WikitextSerializer.js 
b/js/lib/mediawiki.WikitextSerializer.js
index 3fa31a1..6815d52 100644
--- a/js/lib/mediawiki.WikitextSerializer.js
+++ b/js/lib/mediawiki.WikitextSerializer.js
@@ -1199,7 +1199,6 @@
        }
 
        // Check if we need to escape against prefixes or tails
-       var prefixEscape = '', tailEscape = '';
        if (env.conf.wiki.linkPrefixRegex &&
                        node.previousSibling &&
                        // TODO: Also handle zero-width content here?
diff --git a/js/tests/parserTests-blacklist.js 
b/js/tests/parserTests-blacklist.js
index a13dfb6..0ff0d92 100644
--- a/js/tests/parserTests-blacklist.js
+++ b/js/tests/parserTests-blacklist.js
@@ -1430,6 +1430,7 @@
 add("html2wt", "Internal link with kaa linktrail with apostrophes (bug 
27473)");
 add("html2wt", "Internal link with is link prefix");
 add("html2wt", "Internal link with is link trail and link prefix");
+add("html2wt", "Parsoid link prefix escaping");
 add("html2wt", "Parsoid-centric test: Whitespace in ext- and wiki-links should 
be preserved");
 add("html2wt", "Inline interwiki link");
 add("html2wt", "Inline interwiki link with empty title (bug 2372)");
diff --git a/js/tests/parserTests.js b/js/tests/parserTests.js
index c58a3cd..9052955 100755
--- a/js/tests/parserTests.js
+++ b/js/tests/parserTests.js
@@ -1478,12 +1478,12 @@
                if ( options.wt2wt ) {
                        options.modes.push( 'wt2wt' );
                }
-               if ( options.html2html ) {
-                       options.modes.push( 'html2html' );
-               }
                if ( options.html2wt ) {
                        options.modes.push( 'html2wt' );
                }
+               if ( options.html2html ) {
+                       options.modes.push( 'html2html' );
+               }
                if ( options.selser ) {
                        options.modes.push( 'selser' );
                }

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ia918539cf97a15b441e64e4a5b9d6dcd5a1ad783
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Parsoid
Gerrit-Branch: master
Gerrit-Owner: Arlolra <[email protected]>

_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to