4,660 Pages

--<pre>
local p = {}
 
local lib = require('Module:Feature')
 
function p.get(frame)
    local args; if frame.args[1] then args = frame.args else args = frame:getParent().args end
 
    if string.find(args[1], "[0-9]") == nil or string.find(args[1],"%.") == nil then
        return args[1]
    end
 
    local a,b,c
 
    if string.find(args[1], "span") ~= nil then
        a,b,c = args[1]:match"([^.]*).(.*)</span>(.*)"
        if string.find(args[1], "span") <= string.find(args[1], "%.") then
            return a .. ".<small>" .. b .. "</small></span>" .. c
        else
            return a .. ".<small>" .. b .. "</span></small>" .. c
        end
    else
        a, b, c = args[1]:match"([^.]*).([0-9]*)(.*)"
        return a .. ".<small>" .. b .. "</small>" .. c
    end
end
 
function p.getmulti(frame)
    local args; if frame.args[1] then args = frame.args else args = frame:getParent().args end
 
    if string.find(args[1], "[0-9]") == nil or string.find(args[1], "%.") == nil then
        return args[1]
    end
 
    local val    = lib.split(args[1], "%.")
    local values = val[1]
    local i      = 2
    local b, c
 
    while val[i] ~= nil do
        if string.find(val[i],"span") ~= nil then
            b,c    = val[i]:match"(.*)</span>(.*)"
            if string.find(tostring(b), "[0-9]") == nil then
                values=values.."."..val[i]
            else
                if string.find(val[i],"span") <= string.find(val[i], "%.") then
                    values = values .. ".<small>" .. b .. "</small></span>" .. c
                else
                    values = values .. ".<small>" .. b .. "</span></small>" .. c
                end
            end
        else
            b,c    = val[i]:match"([0-9]*)(.*)"
            if string.find(tostring(b), "[0-9]") == nil then
                values=values.."."..val[i]
            else
                values = values .. ".<small>" .. b .. "</small>" .. c
            end
        end
        i = i + 1
    end
 
    return values
end
 
return p
 
--</pre>
--[[Category:Lua]]
Community content is available under CC-BY-SA unless otherwise noted.