Module:Tone superscript

From Omniversalis
Revision as of 15:14, 11 June 2018 by en>Centrist16 (Created page with "local p = {} function p.main(frame) local root = mw.html.create() local arg = frame:getParent().args[1] or "" local x = arg:gsub("%f[%d%s]([%d\*]+)", "<sup>%1</sup>") roo...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

Documentation for this module may be created at Module:Tone superscript/doc

local p = {}

function p.main(frame)
	local root = mw.html.create()
	local arg = frame:getParent().args[1] or ""
	local x = arg:gsub("%f[%d%s]([%d\*]+)", "<sup>%1</sup>")
	root:tag('span'):wikitext(x)
	local tracking = ''
	if string.match(arg, "</?sup>") then tracking = '[[Category:Pages using Tone superscript with sup tags]]' end
	return tostring(root)..tracking
end

return p