Module:Delink/sandbox: Difference between revisions

Content deleted Content added
fix for question mark
Synced (rip one testcase but whatever), dramatically improved efficiency of one of the regex patterns
 
(6 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