Right now it looks like this in the stamtent boxes:
<math>a^2 + b^2 = c^2</math>
Right now it looks like this in the stamtent boxes:
<math>a^2 + b^2 = c^2</math>
The math formatters are in the Math extension, that possibly complicates things here.
@Physikerwelt: We're talking about the wikitext formatter for math here, that seems to be returning plain <math> tags. In order to use that via Lua, we need to preprocess those… that's kind of ugly (and also, slow).
That's to be expected. The wikitext math tag contains tex. Otherwise it would not be wikitext. It has to be differentiated between the html math tags (which contain mathml markup) and the wikitext math tags. That's not the same at all.
If lua does not process wikitext correctly, I think that's nothing that should be solved manually, otherwise other tags will cause similar problems.
The <math> tag needs to be preprocessed if outputted by Lua. The math formatter can hardly do that: Preprocessing depends on the concrete Parser instance.
Also we run into problems here because we probably don't want to pollute our wikitext output with that.
In theory we could special case this either on the PHP side or in Lua and run the wikitext through Parser::preprocess or [[https://www.mediawiki.org/wiki/Extension:Scribunto/Lua_reference_manual#frame:preprocess|frame:preprocess]] respectively. For that we probably want to have another callback on the data type definition that allows us to determine whether the outputted wikitext needs preprocessing or not (that's also quite ugly?).
@hoo anyhow, it was worth a try. Thus we need to debate about some kind of preprocessing.
I'm not really sure how to reproduce this problem. Is there more documentation on the parser function {{#property| ...}} as opposed to here https://www.mediawiki.org/wiki/Extension:Wikibase_Client#Data_transclusion? When I use the property parser function I see the raw texvc source code.
I did not make a lot of progress here. However, at least I found a way to render math using a custom module https://en.wikipedia.org/wiki/Module:ShowMath
This is now part of the module, wd. Also custom parsing functions exist for special types of Math markup in [[ portal.mardi4nfdi.de/wiki/module:wd | non-wmf-hosted ]] wikis:
function Config:getValue(snak, raw, link, short, anyLang, unitOnly, noSpecial, type) ... if datatype == 'string' then ... elseif subtype == 'math' and not raw then local attribute = nil if (type == parameters.property or (type == parameters.qualifier and self.propertyID == aliasesP.hasPart)) and snak.property == aliasesP.definingFormula then attribute = {qid = self.entityID} end-- return mw.getCurrentFrame():extensionTag("math", datavalue, attribute) elseif subtype == 'contentmath' and not raw then return mw.getCurrentFrame():extensionTag{ name="math", content= datavalue, args={forcemathmode="latexml"} } elseif subtype == 'mathml' and not raw then return mw.getCurrentFrame():extensionTag{ name="math", content= datavalue, args={type="pmml", class="wikibase-mathml", forcemathmode="mathml"} }