Page MenuHomePhabricator

Editing a <mapframe> whose GeoJSON has a wikitext link in the title of a point dirty-diffs the link to an HTML link
Closed, ResolvedPublic


  1. Edit in VE
  2. Edit the map
  3. Observe that the GeoJSON has a single point, whose title is [ Maps Team]
  4. Do something that changes the GeoJSON, e.g. add a new point to the map
  5. Observe that the title of the existing point has changed to <a class="external text" href="">Maps Team</a>
  6. Add another point to the map
  7. The title now changes to &lt;a class="external text" href="<a class="external free" href=""></a>"&gt;Maps Team&lt;/a&gt;
  8. If you try to save this, it'll (obviously) break

The same thing happens with other types of wikitext links, like [ Example] or [[Foo]].

Event Timeline

Restricted Application added a subscriber: Aklapper. · View Herald Transcript

From looking at the network traffic is looks like this happens inside api.php?action=sanitize-mapdata: the frontend makes a request to that API module with a GeoJSON blob containing wikitext, and it gets back a GeoJSON blob containing HTML.

This API is supposed to be used for display only.

I think I understand what happens: the "sanitized" GeoJSON is used for display but not in the editor. This works fine as long as you change the GeoJSON in the editor. But when you use the visual tools, the GeoJSON is modified programmatically, and the starting point used for that is the "sanitized" version. The modified version of the "sanitized" GeoJSON is that put into the editor.

Change 418228 had a related patch set uploaded (by Catrope; owner: Catrope):
[mediawiki/extensions/Kartographer@master] Fix corruption of title/description wikitext to HTML when editing in VE

Change 418228 merged by jenkins-bot:
[mediawiki/extensions/Kartographer@master] Fix corruption of title/description wikitext to HTML when editing in VE

Etonkovidova added a subscriber: Etonkovidova.

Checked in testwiki (wmf.25) - the title/description is not changed by unrelated edits.