Cscott has uploaded a new change for review.
https://gerrit.wikimedia.org/r/231705
Change subject: T108563: fix WTS of autolink-like text after [^W]
......................................................................
T108563: fix WTS of autolink-like text after [^W]
Missing backslash meant that we only matched a potential autolink at
the start of an text chunk or after the letter W.
Change-Id: Ife7143c7f484c782a8dd6edf4837c788def3c0ca
---
M lib/mediawiki.WikiConfig.js
M tests/parserTests.txt
2 files changed, 11 insertions(+), 1 deletion(-)
git pull ssh://gerrit.wikimedia.org:29418/mediawiki/services/parsoid
refs/changes/05/231705/1
diff --git a/lib/mediawiki.WikiConfig.js b/lib/mediawiki.WikiConfig.js
index f1d03bd..6e2184a 100644
--- a/lib/mediawiki.WikiConfig.js
+++ b/lib/mediawiki.WikiConfig.js
@@ -420,7 +420,7 @@
}
var alternation = protocols.map(Util.escapeRegExp).join('|');
this._anchoredProtocolRegex = new RegExp('^(' + alternation + ')', 'i');
- this._unanchoredProtocolRegex = new RegExp('(?:\W|^)(' + alternation +
')', 'i');
+ this._unanchoredProtocolRegex = new RegExp('(?:\\W|^)(' + alternation +
')', 'i');
// Extension tags on this wiki, indexed by their aliases.
this.extensionTags = {};
diff --git a/tests/parserTests.txt b/tests/parserTests.txt
index 0ca85c8..edac0ab 100644
--- a/tests/parserTests.txt
+++ b/tests/parserTests.txt
@@ -24921,6 +24921,16 @@
!! end
!! test
+WTS of autolink-like text after an autolink (T108563)
+!! options
+parsoid=html2wt
+!! html/parsoid
+<p><a rel="mw:ExtLink" href="http://example.com">http://example.com</a>
http://example.com is not a link.</p>
+!! wikitext
+http://example.com<nowiki> http://example.com is not a link.</nowiki>
+!! end
+
+!! test
Edited Redirect link should emit a non-piped wikitext link
!! options
parsoid=html2wt
--
To view, visit https://gerrit.wikimedia.org/r/231705
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: Ife7143c7f484c782a8dd6edf4837c788def3c0ca
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/services/parsoid
Gerrit-Branch: master
Gerrit-Owner: Cscott <[email protected]>
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits