Module:Delink: Difference between revisions

From the Croc Wiki, the Croc encyclopedia
Jump to navigationJump to search
Content added Content deleted
(handle nested links)
(better whitespace matching for urls)
Line 22: Line 22:
else
else
s = mw.ustring.match(s, "^%[" .. url_prefix .. "(.*)%]") -- Grab all of the text after the URL prefix and before the final square bracket.
s = mw.ustring.match(s, "^%[" .. url_prefix .. "(.*)%]") -- Grab all of the text after the URL prefix and before the final square bracket.
s = mw.ustring.match(s, '^.-(["<> ].*)') or "" -- Grab all of the text after the first URL separator character ("<> ).
s = mw.ustring.match(s, '^.-(["<>%s].*)') or "" -- Grab all of the text after the first URL separator character.
s = mw.ustring.match(s, "^ ?(.*)") -- If the separating character was a space, trim it off.
s = mw.ustring.match(s, "^%s*(.-)") -- Remove any whitespace from the start of the display text.
return s
return s
end
end