Module:Delink/sandbox: Difference between revisions

Content deleted Content added
Undid revision 1085268485 by Desb42 (talk)
Synced (rip one testcase but whatever), dramatically improved efficiency of one of the regex patterns
 
(2 intermediate revisions by 2 users not shown)
Line 1:
-- This module de-links most wikitext.
 
require("Module:No globalsstrict")
 
local p = {}
Line 29:
s = s:match("(.-) ?%(.-%)$")
elseif s:match(",") then -- If there are no brackets, display only the text before the first comma.
s = s:match("(.-)[^,.]*$")
end
return s