Subramanya Sastry has uploaded a new change for review.

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

Change subject: Followup on 6e335639: Better suppression of spurious <nowiki/>s
......................................................................

Followup on 6e335639: Better suppression of spurious <nowiki/>s

* The regexp testing for nowiki was not properly testing for
  an intervening white-space that acts as a boundary for the regexp.

* Updated an existing parser test that fails without this patch.

* Pages that saw dirty diffs in RT testing are now clean:
  - http://localhost:8000/_rt/dewiki/Gertrude_Schoepperle
  - http://localhost:8000/_rt/eswiki/Amolops_chunganensis
  - http://localhost:8000/_rt/enwiki/Alberta_Forest_Products_Association

Change-Id: I7f0bd2fff3d7fc96ed1042644c097bfc6c1dfe1c
---
M lib/mediawiki.WikitextSerializer.js
M tests/parserTests.txt
2 files changed, 8 insertions(+), 2 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/services/parsoid 
refs/changes/53/133753/1

diff --git a/lib/mediawiki.WikitextSerializer.js 
b/lib/mediawiki.WikitextSerializer.js
index 8bb85ba..f51a1f4 100644
--- a/lib/mediawiki.WikitextSerializer.js
+++ b/lib/mediawiki.WikitextSerializer.js
@@ -721,7 +721,7 @@
                if (!autoURLNowikiTest1) {
                        // Newlines terminate url matching -- so, look for 
non-newline chars only
                        // in the last part of the regexp
-                       autoURLNowikiTest1 = new RegExp("^([" + src1 + src2 + 
"]|[" + src2 + "]+([^" + src2 + "\n]))");
+                       autoURLNowikiTest1 = new RegExp("^([" + src1 + src2 + 
"]|[" + src2 + "]+([^" + src2 + "\\s]))");
                }
 
                return autoURLNowikiTest1;
@@ -733,7 +733,7 @@
 
                        // Newlines terminate url matching -- so, look for 
non-newline chars only
                        // in the last part of the regexp
-                       autoURLNowikiTest2 = new RegExp("^([" + src1 + src3 + 
"]|[" + src3 + "]+([^" + src3 + "\n]))");
+                       autoURLNowikiTest2 = new RegExp("^([" + src1 + src3 + 
"]|[" + src3 + "]+([^" + src3 + "\\s]))");
                }
 
                return autoURLNowikiTest2;
diff --git a/tests/parserTests.txt b/tests/parserTests.txt
index f64a67f..bcb6abf 100644
--- a/tests/parserTests.txt
+++ b/tests/parserTests.txt
@@ -19466,6 +19466,9 @@
 y
 (<a rel="mw:ExtLink" href="http://example.com"; 
data-parsoid='{"stx":"url"}'>http://example.com</a>)
 "<a rel="mw:ExtLink" href="http://example.com"; 
data-parsoid='{"stx":"url"}'>http://example.com</a>"
+<a rel="mw:ExtLink" href="http://example.com"; 
data-parsoid='{"stx":"url"}'>http://example.com</a>,
+<a rel="mw:ExtLink" href="http://example.com"; 
data-parsoid='{"stx":"url"}'>http://example.com</a>, foo
+(<a rel="mw:ExtLink" href="http://example.com"; 
data-parsoid='{"stx":"url"}'>http://example.com</a>.,;:?!) foo
 </p>
 !! wikitext
 x
@@ -19473,6 +19476,9 @@
 y
 (http://example.com)
 "http://example.com";
+http://example.com,
+http://example.com, foo
+(http://example.com.,;:?!) foo
 !! end
 
 ## Parsoid currently fails wt2html on this one!

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I7f0bd2fff3d7fc96ed1042644c097bfc6c1dfe1c
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

Reply via email to