jenkins-bot has submitted this change and it was merged. (
https://gerrit.wikimedia.org/r/366487 )
Change subject: T166413: Piped link with unclosed extlink-like text
......................................................................
T166413: Piped link with unclosed extlink-like text
Change-Id: I25b7d61ce5a62fe036b0a92c2d57c360b5675206
---
M lib/wt2html/pegTokenizer.pegjs
M tests/parserTests.txt
2 files changed, 5 insertions(+), 2 deletions(-)
Approvals:
Subramanya Sastry: Looks good to me, approved
jenkins-bot: Verified
diff --git a/lib/wt2html/pegTokenizer.pegjs b/lib/wt2html/pegTokenizer.pegjs
index e0c02c5..e58dc52 100644
--- a/lib/wt2html/pegTokenizer.pegjs
+++ b/lib/wt2html/pegTokenizer.pegjs
@@ -1301,7 +1301,7 @@
= c:((sol full_table_in_link_caption)
/ urltext
/ (!inline_breaks
- r:( inline_element / '[' text_char+ ']' / . ) { return r; }
+ r:( inline_element / '[' text_char+ ']' $(&(!']' / ']]')) / . ) {
return r; }
)
)+ {
return tu.flattenStringlist(c);
diff --git a/tests/parserTests.txt b/tests/parserTests.txt
index 888777a..c41b7e9 100644
--- a/tests/parserTests.txt
+++ b/tests/parserTests.txt
@@ -7744,13 +7744,16 @@
!! wikitext
[[Main Page|[bar]]]
[[Main Page|This is a [bar]]]
+[[Main Page|[bar]]
!! html/php
<p><a href="/wiki/Main_Page" title="Main Page">[bar]</a>
<a href="/wiki/Main_Page" title="Main Page">This is a [bar]</a>
+<a href="/wiki/Main_Page" title="Main Page">[bar</a>
</p>
!! html/parsoid
<p><a rel="mw:WikiLink" href="./Main_Page" title="Main Page"
data-parsoid='{"stx":"piped"}'>[bar]</a>
-<a rel="mw:WikiLink" href="./Main_Page" title="Main Page"
data-parsoid='{"stx":"piped"}'>This is a [bar]</a></p>
+<a rel="mw:WikiLink" href="./Main_Page" title="Main Page"
data-parsoid='{"stx":"piped"}'>This is a [bar]</a>
+<a rel="mw:WikiLink" href="./Main_Page" title="Main Page"
data-parsoid='{"stx":"piped"}'>[bar</a></p>
!! end
!! test
--
To view, visit https://gerrit.wikimedia.org/r/366487
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: merged
Gerrit-Change-Id: I25b7d61ce5a62fe036b0a92c2d57c360b5675206
Gerrit-PatchSet: 2
Gerrit-Project: mediawiki/services/parsoid
Gerrit-Branch: master
Gerrit-Owner: Arlolra <[email protected]>
Gerrit-Reviewer: Arlolra <[email protected]>
Gerrit-Reviewer: C. Scott Ananian <[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