Module:inline: Difference between revisions

Jump to navigation Jump to search
ਕੋਈ ਸੋਧ ਸਾਰ ਨਹੀਂ
No edit summary
No edit summary
Line 3: Line 3:
function export.parse(term)
function export.parse(term)
     local args = {}
     local args = {}
     local i, key, value = 0
     local i, key, value = 1
     while i < #term do
     while i < #term do
         key, value, i = mw.ustring.match(term, "<([a-zA-Z]+):([^>]+)>()")
         key, value, i = mw.ustring.match(term, "<([a-zA-Z]+):([^>]+)>()", i)
        mw.log("i is a " .. type(i) .. " with value " .. i .. " and term is " .. term .. " with length " .. #term)
         if key and value then args[key] = value else break end
         if key and value then args[key] = value end
     end
     end
     return mw.ustring.gsub(term, "<[a-zA-Z]+:[^>]+>", ""), args
     return mw.ustring.gsub(term, "<[a-zA-Z]+:[^>]+>", ""), args

Navigation menu