Module:Navbox/sandbox: Difference between revisions

Content deleted Content added
No edit summary
simplify the addNewline function - whitespace will be trimmed from named arguments anyway, and { and | don't have any special meaning in Lua patterns
Line 17:
return (mw.ustring.gsub(s, "^%s*(.-)%s*$", "%1"))
end
 
function addNewline(s)
if (s:match('^%s*[\*:;#]') or s:match('^%s*\{\|')) then
return '\n' .. s
else