Module:Delink: Difference between revisions

From the Croc Wiki, the Croc encyclopedia
Jump to navigationJump to search
make each parse optional
(html comments are probably mostly removed by the parser anyway - testing)
(make each parse optional)
Line 138:
local function _delink(args)
local text = args[1] or ""
if not (args.comments == "no") then
-- text = mw.ustring.gsub(text, "<!%-%-.-%-%->", "") -- Remove html comments.
text = delinkLinkClassmw.ustring.gsub(text, "^<!%[-%[-.-%]-%]->", delinkWikilink"") -- De-linkRemove html wikilinkscomments.
end
text = delinkLinkClass(text, "^%[.-%]", delinkURL) -- De-link URLs.
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
text = delinkLinkClass(text, "^%[.-%]", delinkURL) -- De-link URLs.
end
if not (args.whitespace == "no") then
-- text = mw.ustring.gsub(text, "<!%-%-.-%-%->s+", " ") -- Remove htmlextra commentswhitespace.
end
return text
end
Cookies help us deliver our services. By using our services, you agree to our use of cookies.

Navigation menu