Module:Delink: Difference between revisions
From the Croc Wiki, the Croc encyclopedia
Jump to navigationJump to search
Content added Content deleted
(html comments are probably mostly removed by the parser anyway - testing) |
(make each parse optional) |
||
Line 138: | Line 138: | ||
local function _delink(args) |
local function _delink(args) |
||
local text = args[1] or "" |
local text = args[1] or "" |
||
if not (args.comments == "no") then |
|||
⚫ | |||
text = |
text = mw.ustring.gsub(text, "<!%-%-.-%-%->", "") -- Remove html comments. |
||
end |
|||
⚫ | |||
if not (args.wikilinks == "no") then |
|||
text = mw.ustring.gsub(text, "%s+", " ") -- Remove extra whitespace. |
|||
text = delinkLinkClass(text, "^%[%[.-%]%]", delinkWikilink) -- De-link wikilinks. |
|||
end |
|||
if not (args.urls == "no") then |
|||
⚫ | |||
end |
|||
if not (args.whitespace == "no") then |
|||
⚫ | |||
end |
|||
return text |
return text |
||
end |
end |