Last modified: 2014-06-09 20:43:21 UTC

Wikimedia Bugzilla is closed!

Wikimedia migrated from Bugzilla to Phabricator. Bug reports are handled in Wikimedia Phabricator.
This static website is read-only and for historical purposes. It is not possible to log in and except for displaying bug reports and their history, links might be broken. See T54360, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 52360 - Parsoid: Serializer should wrap invalid link targets in <nowiki>
Parsoid: Serializer should wrap invalid link targets in <nowiki>
Status: RESOLVED FIXED
Product: Parsoid
Classification: Unclassified
General (Other open bugs)
unspecified
All All
: High normal
: ---
Assigned To: Gabriel Wicke
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2013-07-31 22:47 UTC by Krinkle
Modified: 2014-06-09 20:43 UTC (History)
2 users (show)

See Also:
Web browser: ---
Mobile Platform: ---
Assignee Huggle Beta Tester: ---


Attachments

Description Krinkle 2013-07-31 22:47:52 UTC
Given the following HTML:

<a rel="mw:WikiLink" href="./]] foo [[bar">Manual</a>

<a href="./]] foo [[bar">Manual</a>


I get [1]:


[[./]] foo [[bar|Manual]]

[./%5D%5D%20foo%20%5B%5Bbar Manual]


The one for external is acceptable (garbage in, garbage out), as it doesn't cause arbitrary wikitext to be passed through.

However the one for mw:WikiLink seems a bug to me. Although it is impossible to link to an invalid link in wikitext (not even with [[<nowiki>invalid </nowiki>]]), that is better than passing through arbitrary wikitext.

That way it at least roundtrips and doesn't mess up the document.

<a rel="mw:WikiLink" href="./]] foo [[bar">Manual</a>

Should serialize to something like:

[[<nowiki>]] foo [[bar</nowiki>|Manual]]

Which parses to:

<a rel="mw:WikiLink" href="./%5D%5D_foo_%5B%5Bbar" data-parsoid="{&quot;stx&quot;:&quot;piped&quot;,&quot;a&quot;:{&quot;href&quot;:&quot;./%5D%5D_foo_%5B%5Bbar&quot;},&quot;sa&quot;:{&quot;href&quot;:&quot;<nowiki>]] foo [[bar</nowiki>&quot;},&quot;dsr&quot;:[1,41,32,2]}">Manual</a>



[1] http://parsoid.wmflabs.org/_html/
Comment 1 Gerrit Notification Bot 2014-05-28 18:16:29 UTC
Change 135814 had a related patch set uploaded by Arlolra:
Wrap invalid link targets in <nowiki> when serializing

https://gerrit.wikimedia.org/r/135814
Comment 2 Arlo Breault 2014-06-09 16:59:31 UTC
Quote from gwicke on the above patch,

"One issue with nowikification is that it breaks the entire link including linked content, with no easy way for a user of VE to fix it. The alternative idea we had was to replace the original link target with one pointing to an error page explaining which chars are valid in titles. The advantage would be that it'd still render as expected, and the user could fix up the target in VE.
The backlinks from the error page would also provide a handy list of pages with broken links."
Comment 3 Gerrit Notification Bot 2014-06-09 20:41:12 UTC
Change 135814 merged by jenkins-bot:
Replace invalid link targets when serializing

https://gerrit.wikimedia.org/r/135814
Comment 4 Arlo Breault 2014-06-09 20:43:21 UTC
We chose to point these links to MediaWiki:Badtitletext.

Note You need to log in before you can comment on or make changes to this bug.


Navigation
Links