Module:Flagg: Difference between revisions

Content deleted Content added
add notext option
Copy from sandbox
 
(2 intermediate revisions by 2 users not shown)
Line 217:
 
--Define separator
local separator = " " --non-breaking space (n)
if ms=="x" then --no separator
separator = ""
Line 289:
out = text
elseif ms=="x" or ms=="n" or ms=="l" then --no separator, non-breaking space, or line break
out = text.."<span class=\"flagicon nowrap\">"..separator..image.."</span>"
elseif ms=="t" then --table cell
out = "style=\"text-align:"..(nalign or "left").."\"|"..text.."||style=\"text-align:"..(align or "center").."\"|<span class=\"flagicon\">"..image.."</span>"
else --fixed-width span box (default)
local width = args["width"] or args["w"] or require("Module:Flaglist").luawidth(size)
out = text.."<span class=\"nowrap\">&nbsp;<span class=\"flagicon\" style=\"display:inline-block;width:"..width.."px;text-align:"..(align or "right").."\">"..image.."</span></span>"
end
else --image left of name
Line 305:
else --fixed-width span box (default)
local width = nopx(args["width"] or args["w"]) or require("Module:Flaglist").luawidth(size)
out = "<span class=\"nowrap\"><span class=\"flagicon\" style=\"display:inline-block;width:"..width.."px;text-align:"..(align or "left").."\">"..image.."</span>&nbsp;</span>"..text
end
end
if string.find(me,"w") then --avoid wrapping
out = "<span class=\"nowrap\">"..out.."</span>"
end
Line 326 ⟶ 323:
 
end
 
p[''] = p.main
 
return p