Module:StripLink

From Trans People Together Wiki
Revision as of 03:04, 11 May 2025 by Admin (talk | contribs)

Documentation for this module may be created at Module:StripLink/doc

local p = {}

function p.strip(frame)
    -- Get the input string (e.g., [url])
    local input = frame.args[1] or ''
    -- Match content between single brackets [ ]
    local stripped = input:match('%[%s*(.-)%s*%]')
    -- If a match was found, return it; otherwise, return the original input
    return stripped or input
end

return p