Module:Tone superscript: Difference between revisions
Appearance
mNo edit summary |
m Jc86035 moved page Module:Jpingauto to Module:Tone superscript without leaving a redirect |
(No difference)
|
Revision as of 00:29, 20 March 2017
Implements {{Tone superscript}}
local p = {}
function p.main(frame)
local root = mw.html.create()
local arg = frame:getParent().args[1] or ""
local x = arg:gsub("(%d)", "<sup>%1</sup>")
x = x:gsub("(%d)</sup>%*<sup>(%d)", "%1*%2")
x = x:gsub("<sup><sup>", "<sup>")
x = x:gsub("</sup></sup>", "</sup>")
root:tag('span'):wikitext(x)
return tostring(root)
end
return p