Module:NavboxMobile: Difference between revisions
EnWikiAdmin (talk | contribs) No edit summary |
EnWikiAdmin (talk | contribs) No edit summary |
||
Line 143: | Line 143: | ||
local function processItem(item, nowrapitems) | local function processItem(item, nowrapitems) | ||
if not item then | |||
return '' -- Prevent nil errors | |||
end | |||
if item:sub(1, 2) == '{|' then | if item:sub(1, 2) == '{|' then | ||
-- Applying nowrap to lines in a table does not make sense. | -- Applying nowrap to lines in a table does not make sense. | ||
Line 153: | Line 156: | ||
local prefix, content = line:match('^([*:;#]+)%s*(.*)') | local prefix, content = line:match('^([*:;#]+)%s*(.*)') | ||
if prefix and not content:match(cfg.pattern.nowrap) then | if prefix and not content:match(cfg.pattern.nowrap) then | ||
line = | line = format(cfg.nowrap_item, prefix, content) | ||
end | end | ||
table.insert(lines, line) | table.insert(lines, line) | ||
Line 164: | Line 167: | ||
return item | return item | ||
end | end | ||