local p = {}
function p.main(frame)
-- Need decode(), since mw.text.unstripNoWiki(frame.args[1]) under
-- {{#invoke:Expand wikitext|preprocessDecodeUnstrip|<nowiki><u>underline</u><ref>text</ref></nowiki></nowiki>}}
-- return "<u>underline</u><ref>text</ref></nowiki>"
--return frame:preprocess(mw.text.decode(mw.text.unstripNoWiki(frame.args[1])))
-- From experiment in https://test.wikipedia.org/w/index.php?title=Module_talk:User:Ans/performance_test/preprocessDecodeUnstrip&action=edit and https://test.wikipedia.org/w/index.php?title=Module_talk:User:Ans/performance_test/preprocessDecodeUnstrip2&action=edit
-- this make code run faster
local text, args = mw.text, frame.args
local s = text.decode(text.unstripNoWiki(args[1]))
return frame:newChild{args={
args[1],
s,
frame:preprocess(s),
}}:preprocess(text.decode(text.unstripNoWiki(
args[2] or '{{#tag:syntaxhighlight|{{{2}}}|lang=wikitext|inline=}} → {{{3}}}'
)))
end
return p