Arlolra has uploaded a new change for review. ( https://gerrit.wikimedia.org/r/344632 )
Change subject: T133267: Escape extlink content when containing ] anywhere ...................................................................... T133267: Escape extlink content when containing ] anywhere Change-Id: Ic2ef54d79c98966cb77f8efdbc53b349496d1f9f --- M lib/html2wt/escapeWikitext.js M tests/parserTests.txt 2 files changed, 4 insertions(+), 2 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/services/parsoid refs/changes/32/344632/1 diff --git a/lib/html2wt/escapeWikitext.js b/lib/html2wt/escapeWikitext.js index 666ba2a..d2eb1fe 100644 --- a/lib/html2wt/escapeWikitext.js +++ b/lib/html2wt/escapeWikitext.js @@ -154,7 +154,7 @@ }; WEHP.aHandler = function(state, text) { - return text.match(/\]$/); + return text.match(/\]/); }; WEHP.tdHandler = function(tdNode, inWideTD, state, text, opts) { diff --git a/tests/parserTests.txt b/tests/parserTests.txt index 2b8d9d4..e500b2d 100644 --- a/tests/parserTests.txt +++ b/tests/parserTests.txt @@ -23848,7 +23848,8 @@ parsoid=html2wt !! html/parsoid <p><a rel="mw:ExtLink" href="http://google.com">[google]</a> -<a rel="mw:ExtLink" href="http://google.com">google]</a></p> +<a rel="mw:ExtLink" href="http://google.com">google]</a> +<a rel="mw:ExtLink" href="http://google.com">goog] le</a></p> <p>[http://google.com]</p> <p>[http://google.com google]</p> <p>[<a rel="mw:ExtLink" href="http://google.com">http://google.com</a>]</p> @@ -23856,6 +23857,7 @@ !! wikitext [http://google.com <nowiki>[google]</nowiki>] [http://google.com <nowiki>google]</nowiki>] +[http://google.com <nowiki>goog] le</nowiki>] <nowiki>[http://google.com]</nowiki> -- To view, visit https://gerrit.wikimedia.org/r/344632 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ic2ef54d79c98966cb77f8efdbc53b349496d1f9f Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/services/parsoid Gerrit-Branch: master Gerrit-Owner: Arlolra <abrea...@wikimedia.org> _______________________________________________ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits