Page MenuHomePhabricator

breaking change: link= <no-value> in icons in image descriptions is broken
Open, Needs TriagePublic

Description

This is a weird problem in de:WP and I think I need help. Consider the following wiki-code (reduced to almost the max):

Before
[[File:NorderneyWinter2010.jpg|thumb|DescBefore [https://www.google.at/ [[File:Erioll world.svg|15px|link=]]] DescAfter ]]
After

Creates a link to https://www.google.at/ (ok), but the area of the link (the <a> tag) is expanded beyond the image and covers also the text 'DescAfter' as well as the text 'After' after the image inclusion (in fact, this is a second <a> tag).

... DescBefore <a rel="nofollow" class="external text" href="https://www.google.at/"><img alt="Erioll world.svg" src="//upload.wikimedia.org/wikipedia/commons/thumb/9/9a/Erioll_world.svg/15px-Erioll_world.svg.png" width="15" height="15" srcset="//upload.wikimedia.org/wikipedia/commons/thumb/9/9a/Erioll_world.svg/23px-Erioll_world.svg.png 1.5x, //upload.wikimedia.org/wikipedia/commons/thumb/9/9a/Erioll_world.svg/30px-Erioll_world.svg.png 2x" data-file-width="256" data-file-height="256" /> DescAfter</a></div></div></div><a rel="nofollow" class="external text" href="https://www.google.at/"><p>After
</p></a></div>

Changing the attribute link= from the empty value to something non-empty fixes the problem, but breaks the link.
I think I could move the link (to google in my example) from around the small icon to the link-attribute of the small icon (did not try), but the code is created by highly optimized templates and moving the link might cost an extra control statement.

This worked like a charm before. Problem popped up only recently. As far as I could check, nothing changed in the template code on de:WP creating that image description.

link=<no-value> is still in the descriptions, e.g. https://en.wikipedia.org/wiki/Help:Pictures

Might be related to T209236

Event Timeline

Herzi.Pinki renamed this task from Image thumb description breaks following text outside image / link= <no-value> to breaking change: link= <no-value> in icons in image descriptions is broken / .Dec 17 2018, 11:42 PM
Herzi.Pinki renamed this task from breaking change: link= <no-value> in icons in image descriptions is broken / to breaking change: link= <no-value> in icons in image descriptions is broken.
Herzi.Pinki updated the task description. (Show Details)

@Legoktm, can you please help again to push that issue?

I think I could move the link (to google in my example) from around the small icon to the link-attribute of the small icon (did not try)

This is actually the best solution.

You should use both an ext link and the link= attribute since that is definitely going to generate broken output because you cannot nest links in links in HTML.

But, the empty link parameter shouldn't have caused the link-in-link scenario, but I am not sure what is causing that. But, in any case, I think using the link attribute for linking the image is cleaner wikitext compared to embedding it in an extlink.