Module:inline: Difference between revisions

ਕੋਈ ਸੋਧ ਸਾਰ ਨਹੀਂ
No edit summary
No edit summary
Line 4: Line 4:
     local args = {}
     local args = {}
     for inline in mw.ustring.gmatch(term, "<([^>]+)>") do
     for inline in mw.ustring.gmatch(term, "<([^>]+)>") do
     if mw.ustring.find(inline, "%:") then
     local s = mw.text.split(inline, ":", true)
    local arg, def = mw.ustring.match(inline, "^([^%:]+)%:([^%:]+)$")
    args[s[1]] = s[2] or true
    args[arg] = def
    else
    args[inline] = true
    end
     end
     end
     return mw.ustring.gsub(term, "<[^>]+>", ""), args
     return mw.ustring.gsub(term, "<[^>]+>", ""), args