Something like http://example.com{{deadlink}} cannot be properly edited in VisualEditor. It should be processed as two pieces: one external link that is followed immediately by one template. Instead, it is presented as the text "http://example.com[]", linked to http://example.com[].
Description
Details
- Reference
- bz65362
| Subject | Author | Repo | Branch | Lines +/- | |
|---|---|---|---|---|---|
| Alienate external links with template-generated attributes | Bartosz Dziewoński | mediawiki/extensions/VisualEditor | master | +28 -3 |
| Status | Subtype | Assigned | Task | ||
|---|---|---|---|---|---|
| Resolved | matmarex | T67362 VisualEditor: URLs followed immediately by {{templates}} are improperly displayed and cannot be edited | |||
| Resolved | Feature | None | T63969 VisualEditor: Deal with universal types like mw:Error, mw:ExpandedAttrs, mw:Placeholder | ||
| Resolved | BUG REPORT | ABreault-WMF | T368724 Rendering diff on broken link with template (visual diff testing) |
Event Timeline
Caused by mw:ExpandedAttrs from Parsoid.
Input:
| http://example.com{{deadlink}} |
Output:
<a data-mw="…" typeof="mw:ExpandedAttrs" about="#mwt2" rel="mw:ExtLink" href="http://example.com" data-parsoid="…">http://example.com</a>
Supposedly the reason for this is that http://example.com{{echo|/index.php}} would produce a link to http://example.com/index.php , rather than a link followed by text. But it depends on what the template outputs; if the output starts with a space or a newline this won't happen. Maybe Parsoid is being a bit too trigger-happy with mw:ExpandedAttrs in the second case?
URLs followed by templates are still broken. However, they now seem to be broken differently: they display as regular links with broken syntax, rather than as alienated nodes.
Change #1143955 had a related patch set uploaded (by Bartosz Dziewoński; author: Bartosz Dziewoński):
[mediawiki/extensions/VisualEditor@master] Alienate external links with template-generated attributes
Until/Unless the Parsoid output is changed, alienated nodes seem to be more correct in this case, so I'm going to restore that behavior. (Yes, I know this comment was 10 years ago.)
Wikitext:
aa http://example.com{{deadlink}} aa
aa http://example.com{{1x|/index.php}} aaOld parser vs Parsoid rendering:
In visual editor, before:
In visual editor, after:
Change #1143955 merged by jenkins-bot:
[mediawiki/extensions/VisualEditor@master] Alienate external links with template-generated attributes
After this change, the links are marked as uneditable, and do not cause corruption when touched. For making them appear right and be editable, see the subtask.


