Page MenuHomePhabricator

ImageMap fails to render when useParsoid=1 if links are providing using the "pipetrick"
Open, Needs TriagePublic

Description

Seen on https://wikitech.wikimedia.org/wiki/Data_Platform/Data_Lake/Edits/MediaWiki_history and avoided with this edit.

Works:

rect 4112 456 5244 1248 [[Help:Wiki_Replicas|Wiki Replicas]]

Fails in Parsoid, works in legacy Parser:

rect 4112 456 5244 1248 [[Help:Wiki_Replicas|]]

Event Timeline

I think you mean [[Help:Wiki_Replicas|]] in the example,

Both parses don't consider that a link,

λ (master) echo "[[Help:Wiki_Replicas|]]" | php maintenance/parse.php
<p>[[Help:Wiki_Replicas|]]
</p>

λ (master) echo "[[Help:Wiki_Replicas|]]" | php maintenance/parse.php --parsoid

<section data-mw-section-id="0" id="mwAQ"><p id="mwAg">[[Help:Wiki_Replicas|]]</p>
</section>

but the legacy implementation of ImageMap does ad hoc parsing of wikilinks that just so happens to support an empty link text,
https://github.com/wikimedia/mediawiki-extensions-ImageMap/blob/master/includes/ImageMap.php#L193-L212

I want to say that the bug is PST should be applied to the extension content so those type of links don't get saved.

For example, try with

<poem>
[[Help:Wiki_Replicas|]]
</poem>

and Parsoid and legacy render that the same.

I think you mean [[Help:Wiki_Replicas|]] in the example,

Oops, yes.

I want to say that the bug is PST should be applied to the extension content so those type of links don't get saved.

Agreed! But that might be a breaking change?

I'm not sure. The case

rect 4112 456 5244 1248 [[Help:Wiki_Replicas]]

doesn't work either for me, the title attribute is not created for the area tag. Is this the same problem? Thank you.

Change #1293168 had a related patch set uploaded (by Arlolra; author: Arlolra):

[mediawiki/extensions/ImageMap@master] [parsoid] Fix title on area tags for simple wikilinks

https://gerrit.wikimedia.org/r/1293168

Is this the same problem?

No, in the above, the entire imagemap failed to render. I pushed a fix for the bug you pointed out in T396615#11953480

Change #1293168 merged by jenkins-bot:

[mediawiki/extensions/ImageMap@master] [parsoid] Fix title on area tags for simple wikilinks

https://gerrit.wikimedia.org/r/1293168