https://bugzilla.wikimedia.org/show_bug.cgi?id=52360
Web browser: ---
Bug ID: 52360
Summary: Parsoid: Serializer should wrap invalid link targets
in <nowiki>
Product: Parsoid
Version: unspecified
Hardware: All
OS: All
Status: NEW
Severity: normal
Priority: Unprioritized
Component: General
Assignee: [email protected]
Reporter: [email protected]
CC: [email protected]
Classification: Unclassified
Mobile Platform: ---
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="{"stx":"piped","a":{"href":"./%5D%5D_foo_%5B%5Bbar"},"sa":{"href":"<nowiki>]]
foo [[bar</nowiki>"},"dsr":[1,41,32,2]}">Manual</a>
[1] http://parsoid.wmflabs.org/_html/
--
You are receiving this mail because:
You are on the CC list for the bug.
_______________________________________________
Wikibugs-l mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/wikibugs-l