Page MenuHomePhabricator

Internal links surrounded by square brackets should be parsed correctly
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

Restricted Application added subscribers: jeblad, Aklapper. · View Herald TranscriptApr 3 2019, 11:13 PM
cscott added a subscriber: cscott.Apr 4 2019, 1:08 PM

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.

osorio-juan-microsoft added a comment.EditedApr 4 2019, 8:55 PM

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 Backlog to Link syntax (links & media) on the Parsoid board.