As pointed out by @Tpt in T210926#4999461:
If Wikibase Client tries to format a coordinate via entity:formatStatements() in Lua, the editor will need to manually preprocess the result of these expressions. That is unacceptable, as it breaks the current way these constructs are used, it is undocumented and also very inconvenient to use. The {{#statements:…}} parser function seems to be unaffected by this.
As a solution, we should make sure we Parser::preprocess all (or just if <maplink> is in there?) wikitext generated in StatementTransclusionInteractor::formatSnaks. For this to work, we will need to pass the current Parser instance through to that function :/
As (AFAIR) re-preprocessing already pre-processed wikitext is a noop, we can safely do this change.
Steps to reproduce
- Set up the Kartographer extension on your client wiki and confirm it is working.
- Enable the useKartographerMaplinkInWikitext Wikibase Client settings.
- Add a globe coordinate value to an item (needs to be an earth coordinate)
- Access that information on a client wiki page via the following Lua snippet: mw.wikibase.getEntity( 'yourEntityId' ):formatStatements( 'yourGlobeCoordPropertyId' ).value
Right now this is going to show you <maplink …> on the page, while it should output an interactive map showing the coordinate.