Jump to content

Module:CTD: Difference between revisions

408 bytes added ,  Tuesday at 03:13
Add nospaces() helper, used to build compact short names for category names
mNo edit summary
(Add nospaces() helper, used to build compact short names for category names)
 
Line 74: Line 74:
-- return point_at_end(result)
-- return point_at_end(result)
return result
return result
end
-------------------------------------------------
-- Remove whitespace from a short piece of text (e.g. initials), to build
-- a compact variant of a person's short name for category names.
-- Used in : Template:CTD article
-- Call example:
-- {{#invoke: CTD | nospaces | {{{initials|}}} }}
function ctd.nospaces( frame )
local text = frame.args[1] or ''
return ( mw.ustring.gsub( text, '%s+', '' ) )
end
end


return ctd
return ctd