2,788
edits
No edit summary |
No edit summary |
||
(8 intermediate revisions by 2 users not shown) | |||
Line 3: | Line 3: | ||
function export.parse(term) | function export.parse(term) | ||
local args = {} | local args = {} | ||
for inline in mw.ustring.gmatch(term, "<([^>]+)>") do | |||
local s = mw.text.split(inline, ":", true) | |||
args[s[1]] = s[2] or true | |||
if #s > 2 then mw.addWarning("multiple : found in inline string") end | |||
end | end | ||
return mw.ustring.gsub(term, "< | return mw.ustring.gsub(term, "<[^>]+>", ""), args | ||
end | end | ||
return export | return export |