Module:government: Difference between revisions

Jump to navigation Jump to search
ਕੋਈ ਸੋਧ ਸਾਰ ਨਹੀਂ
No edit summary
No edit summary
Line 78: Line 78:
local temp = args[i]
local temp = args[i]
local with_needed = true
if mw.ustring.sub(temp, 1, 1) == "&" then
if mw.ustring.sub(temp, 1, 1) == "&" then
Line 83: Line 84:
else
else
append("''with'' ")
append("''with'' ")
with_needed = false
end
end
Line 92: Line 94:
local function remove_temp(regex)
local function remove_temp(regex)
temp = mw.ustring.gsub(temp, regex, "")
temp = mw.ustring.gsub(temp, regex, "")
end
local with_text = ""
if with_needed then
with_text = " with"
with_needed = false
end
end
if mw.ustring.find(temp, "^%s*%/%s*") then
if mw.ustring.find(temp, "^%s*%/%s*") then
append(" ''or'' ")
append(" ''or" .. with_text .. "'' ")
remove_temp("^%s*%/%s*")
remove_temp("^%s*%/%s*")
elseif mw.ustring.find(temp, "^%s*%+%s*") then
elseif mw.ustring.find(temp, "^%s*%+%s*") then
append(" ''and'' ")
append(" ''and" .. with_text .. "'' ")
remove_temp("^%s*%+%s*")
remove_temp("^%s*%+%s*")
else
else

Navigation menu