Module:HasTag: Difference between revisions

Jump to navigation Jump to search
no edit summary
(Created page with "local p = {} function p.main(frame) return p.hasTag(frame.args[1], frame.args[2]) end function p.hasTag(tag, wikitext) if tag:len() > 50 then error("Tag too long: " .. tag) end local i = wikitext:find('\'"`UNIQ%-%-' .. tag .. '%-') if i == nil then return '' else return i end end return p")
 
No edit summary
 
(2 intermediate revisions by the same user not shown)
Line 6: Line 6:


function p.hasTag(tag, wikitext)
function p.hasTag(tag, wikitext)
tag = tag:gsub('%s+', '')
if tag:len() > 50 then
if tag:len() > 50 then
error("Tag too long: " .. tag)
error("Tag too long: " .. tag)

Navigation menu