Page MenuHomePhabricator

mw.text.unstripNoWiki also unstrips <math> tags
Closed, InvalidPublic

Description

On enwiki, using mw.text.unstripNoWiki on <math> tags will give you the raw HTML output. Sample code:

local p = {}

function p.main()
	local frame = mw.getCurrentFrame()
	return mw.text.unstripNoWiki(frame:preprocess('<math>foo</math>'))
end

return p

When calling that from the debug console with =p.main(), I get <img class="mwe-math-fallback-image-inline tex" alt="foo" src="//upload.wikimedia.org/math/a/c/b/acbd18db4cc2f85cedef654fccc4a4d8.png" />. Instead, it should be showing the strip marker.

Event Timeline

MrStradivarius raised the priority of this task from to Needs Triage.
MrStradivarius updated the task description. (Show Details)
MrStradivarius added a subscriber: MrStradivarius.
Restricted Application added subscribers: StudiesWorld, Aklapper. · View Herald TranscriptDec 10 2015, 8:35 AM
Anomie closed this task as Invalid.Dec 10 2015, 1:24 PM
Anomie claimed this task.
Anomie added a subscriber: Anomie.

The Math extension is registering its strip markers as 'nowiki' markers, so when Scribunto calls StripState::unstripNoWiki() the math markers are included in the unstripping. I don't know if there's any particular reason that T62799 wanted to use nowiki markers rather than general markers, possibly so it would be passed through Tidy.

I note that the core "<html>" tag (see $wgRawHtml) is also registered as a 'nowiki' marker, as are tags from the NamespaceHTML, SecureHTML, and MathSearch extensions.

TheDJ added a subscriber: TheDJ.Dec 10 2015, 1:38 PM

I remember something about mathml output using nowiki markers, because the validators don't know about mathml.. How this works with other modes etc, etc and if that was carelessly or correctly applied is difficult to say without further investigation.