Fandom


local p = {}
 
function p.count(frame)
    local _, count = string.gsub(frame.args[1], frame.args[2], "")
    if count ~= nil then return count else return 0 end
end
 
function p.parent_if(frame)
    toCheck = frame.args[1]
    parentArgs = frame:getParent().args
    if parentArgs[toCheck] ~= nil then
        return true
    else
        return false
    end
end
 
function p.trim(frame)
    return frame.args[1]:match'^%s*(.*%S)' or ''
end
 
function p.rm_whitespaces(frame)
    local s, _ = frame.args[1]:gsub(" ", "")
    return s
end
 
function p.commawhitespaces(frame)
    local s, _ = frame.args[1]:gsub(", ", ",")
    return s
end
 
function p.rm_underscore(frame)
    local s, _ = frame.args[1]:gsub("_", " ")
    return s
end
 
return p
Nutzung von Community-Inhalten gemäß CC-BY-SA , sofern nicht anders angegeben.