jenkins-bot has submitted this change and it was merged.
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(-)
Approvals:
Subramanya Sastry: Looks good to me, approved
jenkins-bot: Verified
diff --git a/lib/mediawiki.WikiConfig.js b/lib/mediawiki.WikiConfig.js
index 144483d..6228457 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 4af7b0e..1f3f427 100644
--- a/tests/parserTests.txt
+++ b/tests/parserTests.txt
@@ -24931,6 +24931,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: merged
Gerrit-Change-Id: Ife7143c7f484c782a8dd6edf4837c788def3c0ca
Gerrit-PatchSet: 2
Gerrit-Project: mediawiki/services/parsoid
Gerrit-Branch: master
Gerrit-Owner: Cscott <[email protected]>
Gerrit-Reviewer: Arlolra <[email protected]>
Gerrit-Reviewer: Subramanya Sastry <[email protected]>
Gerrit-Reviewer: jenkins-bot <>
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits