<maplink> and <mapframe> have a data-mw="interface" added as an attribute. This is conflicting with Parsoid's usage of data-mw="…": when generating the extension content, "interface" gets erased by Parsoid's own information.
The data-mw="interface" is added for security reasons: attributes starting with "data-mw*" are stripped from HTML tags in wikitext. Selecting over data-mw="interface" in later JavaScript allows us to make sure that the maplink/mapframe tags are generated from code that's part of the Kartographer extension rather than injected by a user through wikitext.
Several options can be considered:
- Change the selectors to check for the presence of a "data-mw" attribute and not its value. I'm personally not a fan, because it [?]; additionally, it may conflict with possible plans to eventually stash data-mw.
- Change the attribute to data-mw-interface="true" (or empty string). I'm also not necessarily in favor because I believe that, as far as Kartographer is concerned, the generated content is not "interface" per se, and should not be handled in the same way as other elements that are tagged in the same way, but more clearly part of the user interface or skin.
- Introduce a data-mw-kartographer="…", which will contain the necessary information for post-processing when these exist, and is explicitly added when creating the tag, even if it's empty. The selector then checks for the existence of this data-mw-kartographer attribute. That may not be ideal in the context of a stripped-down version of the generated HTML, where this attribute would need to be emptied, but not removed. While not ideal either, I think this option has my preference.
Note that there's a dependency of that JavaScript selector in Wikidata to be fixed as well.