Module:UtilsMarkup/Format

local p = {}

function p.format(text, args) if not args then return text end local frame = mw.getCurrentFrame local result = text if args.bold then result = string.format("%s", result) end if args.italic then result = string.format("%s", result) end if args.fontSize then result = string.format(' %s ', fontSize, result) end if args.pre then result = frame:extensionTag("pre", text) end if args.code then result = frame:extensionTag("code", text) end if args.nowiki then result = frame:extensionTag("nowiki", text) end if args.syntaxHighlight then result = frame:extensionTag("syntaxhighlight", text, {			lang = args.syntaxHighlight		}) end if args.class then result = string.format(' %s ', args.class, result) end return result end

return p