Content deleted Content added
Sophivorus (talk | contribs) Finish removing the need to internationalize and localize redirects |
Sophivorus (talk | contribs) Replace leadOnly for keepSubsections |
||
Line 531:
end
local function cleanupText(text,
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
end
text = mw.ustring.gsub(text, "<[Nn][Oo][Ii][Nn][Cc][Ll][Uu][Dd][Ee]>.-</[Nn][Oo][Ii][Nn][Cc][Ll][Uu][Dd][Ee]>", "") -- remove noinclude bits
Line 647:
if not text then return err("Cannot read a valid page: first name is " .. firstpage) end
local keepRefs = options.keepRefs
local keepSubsections = options.keepSubsections
▲ text = cleanupText(text, leadOnly, keepRefs)
local pageopts = {} -- pageopts (even if value is "") have priority over global options
Line 814 ⟶ 813:
function p.checkimage(image) return checkimage(image) end
function p.parseimage(text, start) return parseimage(text, start) end
function p.cleanupText(text,
function p.main(pagenames, options) return main(pagenames, options) end
function p.numberflags(str) return numberflags(str) end
|