Page MenuHomePhabricator

Wikitext change: Internal links surrounded by square brackets should be parsed as an internal link
Open, MediumPublic

Description

Internal links surrounded by square brackets, like [[[Main Page]]], should be parsed correctly, as <nowiki>[</nowiki>[[Main Page]]<nowiki>]</nowiki>.

Currently, this is being parsed as <nowiki>[[[Main Page]]]</nowiki> instead.

Event Timeline

This is consistent between Parsoid and PHP:

$ echo '[[[Main Page]]]' | bin/parse.js --normalize
<p>[[[Main Page]]]</p>

-vs-

$ echo '[[[Main Page]]]' | php maintenance/parse.php 
<p>[[[Main Page]]]
</p>

So that's pretty much "how it's supposed to work". Changing this would be wikitext 2.0-scope work.

So that's pretty much "how it's supposed to work". Changing this would be wikitext 2.0-scope work.

Thanks for that info! Would a good first approach be fixing the HTML to WikiText parsing?

$ echo '[<a href="/wiki/Main_Page" title="Main Page">Main Page</a>]' | node parse.js --html2wt
[[[Main Page]]]

It should instead output <nowiki>[</nowiki>[[Main Page]]<nowiki>]</nowiki>

ssastry triaged this task as Medium priority.Jun 10 2019, 8:37 PM
ssastry moved this task from Needs Triage to Link syntax (links & media) on the Parsoid board.
ssastry renamed this task from Internal links surrounded by square brackets should be parsed correctly to Wikitext change: Internal links surrounded by square brackets should be parsed as an internal link.Feb 28 2020, 5:12 PM
ssastry moved this task from Link syntax (links & media) to Future Ideas on the Parsoid board.