Content deleted Content added
Sophivorus (talk | contribs) Add truthy check for nobold |
Sophivorus (talk | contribs) Rename truthy() for falsy(), as the function actually checked for falsy values |
||
Line 67:
end
-- Helper function to test for
local function
if not value or value == "" or value == "0" or value == "false" or value == "no" then
return
end
return
end
Line 480:
t = t .. token -- keep wanted block templates
elseif
t = t .. token -- keep tables
Line 541:
local function cleanupText(text, keepSubsections, keepRefs)
text = mw.ustring.gsub(text, "<!%-%-.-%-%->","") -- remove HTML comments
if
text = mw.ustring.gsub(text, "\n==.*","") -- remove first ==Heading== and everything after it
text = mw.ustring.gsub(text, "^==.*","") -- ...even if the lead is empty
Line 551:
text = mw.ustring.gsub(text, "</[Oo][Nn][Ll][Yy][Ii][Nn][Cc][Ll][Uu][Dd][Ee]>.*", "") -- remove text after last onlyinclude section
end
if
text = mw.ustring.gsub(text, "<%s*[Rr][Ee][Ff][^>]-/%s*>", "") -- remove refs cited elsewhere
text = mw.ustring.gsub(text, "<%s*[Rr][Ee][Ff].->.-<%s*/%s*[Rr][Ee][Ff]%s*>", "") -- remove refs
Line 692:
-- remove '''bold text''' if requested
if
text = filetext .. text
|