jenkins-bot has submitted this change and it was merged. ( https://gerrit.wikimedia.org/r/354235 )
Change subject: Allow \r\n in wikilink titles. ...................................................................... Allow \r\n in wikilink titles. This fixes an RT testing regression on [[it:Teenage Mutant Ninja Turtles - Tartarughe Ninja]] caused by this fragment of (bogus) wikitext: |autori = [[ Ciro Nieli Joshua Sternin J. R. Ventimilia]] In general our practice now is *not* to try to validate the title inside the tokenizer, but instead to accept the same set of characters here that the PHP preprocessor does and wait until later title validation to unlink bogus titles. Change-Id: I0ed15d6e897d2734ad8436c73de2fdcc4d0f563a --- M lib/wt2html/pegTokenizer.pegjs M tests/parserTests.txt 2 files changed, 16 insertions(+), 1 deletion(-) Approvals: jenkins-bot: Verified Arlolra: Looks good to me, approved diff --git a/lib/wt2html/pegTokenizer.pegjs b/lib/wt2html/pegTokenizer.pegjs index 2664c17..72b2d42 100644 --- a/lib/wt2html/pegTokenizer.pegjs +++ b/lib/wt2html/pegTokenizer.pegjs @@ -1950,7 +1950,7 @@ wikilink_preprocessor_text = r:( t:$[^<[{\n\r\t|!\]}{ &\-]+ // XXX gwicke: any more chars we need to allow here? - / !inline_breaks wr:( directive / $( !"]]" ( text_char / [!<\-\}\]] ) ) ) + / !inline_breaks wr:( directive / $( !"]]" ( text_char / [!<\-\}\]\n\r] ) ) ) { return wr; } )+ { return tu.flattenStringlist(r); diff --git a/tests/parserTests.txt b/tests/parserTests.txt index 2d107e7..0d93294 100644 --- a/tests/parserTests.txt +++ b/tests/parserTests.txt @@ -5332,6 +5332,21 @@ !! end !! test +Wikilinks with embedded newlines are not broken +!! wikitext +{{echo|[[ Foo +B +C]]}} +!! html/php +<p>[[ Foo +B +C]] +</p> +!! html/parsoid +<p typeof="mw:Transclusion" data-mw='{"parts":[{"template":{"target":{"wt":"echo","href":"./Template:Echo"},"params":{"1":{"wt":"[[ Foo\nB\nC]]"}},"i":0}}]}'>[[ Foo B C]]</p> +!! end + +!! test Broken templates !! options parsoid=wt2html -- To view, visit https://gerrit.wikimedia.org/r/354235 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: I0ed15d6e897d2734ad8436c73de2fdcc4d0f563a Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/services/parsoid Gerrit-Branch: master Gerrit-Owner: C. Scott Ananian <canan...@wikimedia.org> Gerrit-Reviewer: Arlolra <abrea...@wikimedia.org> Gerrit-Reviewer: Subramanya Sastry <ssas...@wikimedia.org> Gerrit-Reviewer: jenkins-bot <> _______________________________________________ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits