Module:krv-script: Difference between revisions

Jump to navigation Jump to search
ਕੋਈ ਸੋਧ ਸਾਰ ਨਹੀਂ
No edit summary
No edit summary
Line 110: Line 110:
end
end


function convert(text, old)
function convert(text, old, classical)
local it = correspondences
local it = correspondences
if old then it = correspondences_old end
if old then it = correspondences_old end
Line 117: Line 117:
     for _, c in ipairs(it) do
     for _, c in ipairs(it) do
     text = mw.ustring.gsub(text, c[1], c[2])
     text = mw.ustring.gsub(text, c[1], c[2])
    mw.log(text)
     end
     end
    if classical then
    text = mw.ustring.gsub(text, "%s", "·")
    text = mw.ustring.gsub(text, "%p", "")
    text = '<span style="font-family: sans-serif">' .. text .. '</span>'
end
return text
return text
end
end
Line 137: Line 141:
     if parameters["link"] then return demacron(text) end
     if parameters["link"] then return demacron(text) end
      
      
     local script = convert(text, parameters["old"] or false)
     local script = convert(text, parameters["old"] or false, parameters["classical"] or false)
      
      
     local out = script
     local out = script

Navigation menu