Page MenuHomePhabricator

mw.text.unstripNoWiki doesn't work in special:ExpandTemplates
Closed, DuplicatePublic

Description

Suppose there is a module named "unstrip" with the contents

local p = {}
function p.unstrip(frame)
    return mw.text.nowiki(mw.text.unstripNoWiki(frame.args[1]))
end
return p

(the mw.text.nowiki is to keep the output from being expanded by the parser)

Calling this module normally works as expected, with {{#invoke:Unstrip|unstrip|<nowiki>foo</nowiki>}} generating "foo" as output.
However, if this is run through Special:ExpandTemplates, the strip marker doesn't get expanded, and the result is a strip marker `&#39;&#34;UNIQ--nowiki-00000000-QINU&#34;&#39;`

Event Timeline

This comment was removed by Pppery.

Non-"function" tags, including <nowiki>, aren't expanded by the parsing mode used in Special:ExpandTemplates. Instead they get internally handled using general strip markers, which Scribunto cannot unstrip.

The way Special:ExpandTemplates works here is a bit like if you had done {{subst:#invoke:Unstrip|unstrip|<nowiki>foo</nowiki>}} instead.

Anomie changed the task status from Invalid to Declined.Jul 18 2018, 3:55 PM