Page MenuHomePhabricator

Template inside a link renders weirdly after the page gets VEdited
Open, MediumPublic8 Estimate Story Points

Description

https://en.wikipedia.org/w/index.php?title=Christian_Georg_Kohlrausch&diff=next&oldid=682549552

''[[Wikipedia:Link rot|<span title=" since September 2015">dead link</span>]]''&#x5D;

Event Timeline

Josve05a raised the priority of this task from to Needs Triage.
Josve05a updated the task description. (Show Details)
Josve05a added a project: VisualEditor.
Josve05a added a subscriber: Josve05a.
Restricted Application added a subscriber: Aklapper. · View Herald TranscriptSep 25 2015, 10:55 AM
Jdforrester-WMF renamed this task from VE substituted a template to <div>-tags to A template got substituted to <div>-tags (due to copy-and-paste?).Sep 29 2015, 7:08 PM
Jdforrester-WMF triaged this task as Low priority.
Jdforrester-WMF set Security to None.
Jdforrester-WMF edited a custom field.
Jdforrester-WMF moved this task from To Triage to Freezer on the VisualEditor board.
Josve05a renamed this task from A template got substituted to <div>-tags (due to copy-and-paste?) to A template got substituted (due to copy-and-paste?).Oct 3 2015, 9:53 PM
Josve05a added a subscriber: Larske.Oct 4 2015, 4:14 AM
Josve05a raised the priority of this task from Low to Medium.Oct 4 2015, 12:14 PM

Since this breaks appearance of the articles it edits (https://sv.wikipedia.org/w/index.php?title=Sverige&oldid=30649922#cite_note-68), this should be prioritised accordingly.

We may be talking about two different things here.
For the first one, see the question in the title: have you been able to verify (independently or with the users who made the edits) if the issue is due to copy/paste, or if there's another way to reproduce it?

For the second one, we're talking about a link which looks like
[http://www.pitzer.edu/academics/faculty/zuckerman/Ath-Chap-under-7000.pdf Atheism: Contemporary Rates and Patterns {{pdf}}] .
Why is the PDF template inside the link? Everything works just fine when it's placed outside.

Actually, it's the same problem: putting a template inside a link.
What the user did was selecting the entire line, including the dead link template, and applying a different link to it.
I'll change the title of this task accordingly, but I'm inclined to think this is not a bug, but more users trying to kill MediaWiki...

Josve05a added a comment.EditedNov 21 2015, 2:43 PM

(edit comment conflict)
I was assuming those were the same problem, since both were substituted or similarly. If they are different errors, feel free to split this. However in the first url it was also inside the brackets.

Elitre renamed this task from A template got substituted (due to copy-and-paste?) to Template inside a link renders weirdly after the page gets VEdited.Nov 21 2015, 2:43 PM
Elitre edited projects, added VisualEditor-Links; removed VisualEditor-CopyPaste.

users trying to kill MediaWiki...

As long as it doens't kill MediaWiki and it works as a workaround, the expected result should not be altered by VE.

cscott added a subscriber: cscott.

Can we get a dump of exactly what the HTML looks like before and after the edit? That will help us determine if this is a Parsoid or a VE bug.

In theory having a template in the link text should not be a problem for Parsoid as far as I know.

Can we get a dump of exactly what the HTML looks like before and after the edit? That will help us determine if this is a Parsoid or a VE bug.

@cscott, https://www.mediawiki.org/wiki/Parsoid/Debugging#Dumping_HTML_DOM_in_VE

URL to diff:

https://sv.wikipedia.org/w/index.php?title=Sverige&diff=next&oldid=30692384

wikicode before VE edit:

eller icke-troende (på Gud).<ref>Zuckerman, Phil (2007), [http://www.pitzer.edu/academics/faculty/zuckerman/Ath-Chap-under-7000.pdf Atheism: Contemporary Rates and Patterns {{pdf}}] i ''Cambridge Companion to Atheism''. Cambridge: Cambridge University Press. ISBN 0-521-60367-6</ref> År 2013 var ändå

HTML code before VE edit:

eller icke-troende (på Gud).<sup id="cite_ref-68" class="reference"><a href="#cite_note-68"><span class="cite-reference-link-bracket">[</span>68<span class="cite-reference-link-bracket">]</span></a></sup> År 2013 var ändå

<li id="cite_note-68"><a href="#cite_ref-68">^</a> <span class="reference-text">Zuckerman, Phil (2007), <a rel="nofollow" class="external text" href="http://www.pitzer.edu/academics/faculty/zuckerman/Ath-Chap-under-7000.pdf">Atheism: Contemporary Rates and Patterns</a> <a href="/wiki/Fil:Noia_64_mimetypes_pdf.png" class="image"><img alt="Noia 64 mimetypes pdf.png" src="upload.wikimedia.org/wikipedia/commons/thumb/7/7d/Noia_64_mimetypes_pdf.png/14px-Noia_64_mimetypes_pdf.png" width="14" height="14" srcset="upload.wikimedia.org/wikipedia/commons/thumb/7/7d/Noia_64_mimetypes_pdf.png/21px-Noia_64_mimetypes_pdf.png 1.5x, //upload.wikimedia.org/wikipedia/commons/thumb/7/7d/Noia_64_mimetypes_pdf.png/28px-Noia_64_mimetypes_pdf.png 2x" data-file-width="64" data-file-height="64" /></a>&#160;<small><a href="/wiki/Portable_Document_Format" title="Portable Document Format">PDF</a></small> i <i>Cambridge Companion to Atheism</i>. Cambridge: Cambridge University Press. <a href="/wiki/Special:Bokk%C3%A4llor/0521603676" class="internal mw-magiclink-isbn">ISBN 0-521-60367-6</a></span></li>

wikicode after VE edit:

eller icke-troende (på Gud).<ref>Zuckerman, Phil (2007), [http://www.pitzer.edu/academics/faculty/zuckerman/Ath-Chap-under-7000.pdf Atheism: Contemporary Rates and Patterns {{pdf}}][./Fil:Noia_64_mimetypes_pdf.png [[Fil:Noia_64_mimetypes_pdf.png|link=|14x14px]]]&nbsp;<small>[[Portable Document Format|PDF]]</small> i ''Cambridge Companion to Atheism''. Cambridge: Cambridge University Press. ISBN 0-521-60367-6</ref> År 2013 var ändå

HTML code after VE edit:

eller icke-troende (på Gud).<sup id="cite_ref-68" class="reference"><a href="#cite_note-68"><span class="cite-reference-link-bracket">[</span>68<span class="cite-reference-link-bracket">]</span></a></sup> År 2013 var ändå

<li id="cite_note-68"><a href="#cite_ref-68">^</a> <span class="reference-text">Zuckerman, Phil (2007), <a rel="nofollow" class="external text" href="http://www.pitzer.edu/academics/faculty/zuckerman/Ath-Chap-under-7000.pdf">Atheism: Contemporary Rates and Patterns</a> <a href="/wiki/Fil:Noia_64_mimetypes_pdf.png" class="image"><img alt="Noia 64 mimetypes pdf.png" src="upload.wikimedia.org/wikipedia/commons/thumb/7/7d/Noia_64_mimetypes_pdf.png/14px-Noia_64_mimetypes_pdf.png" width="14" height="14" srcset="upload.wikimedia.org/wikipedia/commons/thumb/7/7d/Noia_64_mimetypes_pdf.png/21px-Noia_64_mimetypes_pdf.png 1.5x, upload.wikimedia.org/wikipedia/commons/thumb/7/7d/Noia_64_mimetypes_pdf.png/28px-Noia_64_mimetypes_pdf.png 2x" data-file-width="64" data-file-height="64" /></a>&#160;<small><a href="/wiki/Portable_Document_Format" title="Portable Document Format">PDF</a></small>[./Fil:Noia_64_mimetypes_pdf.png <img alt="Noia 64 mimetypes pdf.png" src="upload.wikimedia.org/wikipedia/commons/thumb/7/7d/Noia_64_mimetypes_pdf.png/14px-Noia_64_mimetypes_pdf.png" width="14" height="14" srcset="upload.wikimedia.org/wikipedia/commons/thumb/7/7d/Noia_64_mimetypes_pdf.png/21px-Noia_64_mimetypes_pdf.png 1.5x, upload.wikimedia.org/wikipedia/commons/thumb/7/7d/Noia_64_mimetypes_pdf.png/28px-Noia_64_mimetypes_pdf.png 2x" data-file-width="64" data-file-height="64" />]&#160;<small><a href="/wiki/Portable_Document_Format" title="Portable Document Format">PDF</a></small> i <i>Cambridge Companion to Atheism</i>. Cambridge: Cambridge University Press. <a href="/wiki/Special:Bokk%C3%A4llor/0521603676" class="internal mw-magiclink-isbn">ISBN 0-521-60367-6</a></span></li>

Josve05a moved this task from Backlog to VisualEditor Liaising on the User-Josve05a board.

I think I have found a similar situation here:

https://en.wikipedia.org/w/index.php?title=Latin_American_music_in_the_United_States&diff=prev&oldid=889404456

There was an ISBN template inside a URL link (which is garbage, I know), and VE moved the link end bracket and inserted unnecessary span tags. You can see it happen repeatedly over a series of edits here:

https://en.wikipedia.org/w/index.php?diff=891141344&oldid=890457473&title=Role_of_music_in_World_War_II&type=revision

It makes unnecessary cleanup work for gnomes. VE should ignore templates inside of URL links, please, not make them worse.

Could the original just be another case of "you can't copy wikitext templates when you're reading an HTML page", and therefore a case of T54091?

@Jonesey95, I think that error may be specific to the {{ISBN}} template. Compare the same edit with {{fact}} vs the ISBN template: https://en.wikipedia.org/w/index.php?title=User:Whatamidoing_(WMF)/sandbox&diff=935153206&oldid=935153183&diffmode=source vs https://en.wikipedia.org/w/index.php?title=User:Whatamidoing_(WMF)/sandbox&diff=935153094&oldid=935153060&diffmode=source (Placing the {{fact}} tag looks obviously broken beforehand, too.) Maybe split that to a different task?