Module:Tone superscript: Difference between revisions

Content deleted Content added
mNo edit summary
simplified regex, also only match numbers following not-numbers and not whitespace
Line 4:
local root = mw.html.create()
local arg = frame:getParent().args[1] or ""
local x = arg:gsub("(%d)", "<sup>%1</sup>"):gsub("(f[%d)</sup>%*<sup>(%d)", "%1*%2"):gsub("<sup><sup>s]([%d%\*]+)</sup></sup>", "<sup>%1</sup>")
root:tag('span'):wikitext(x)
local tracking = ''