Module:government: Difference between revisions

ਕੋਈ ਸੋਧ ਸਾਰ ਨਹੀਂ
No edit summary
No edit summary
Line 94: 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 mw.ustring.sub(temp, 1, 1) == "&" then
temp = mw.ustring.sub(temp, 2)
elseif with_needed then
with_text = " with"
end
end
if mw.ustring.find(temp, "^%s*%/%s*") then
if mw.ustring.find(temp, "^%s*%/%s*") then
append(" ''or" .. with_text .. "'' ")
append(" ''or'' ")
remove_temp("^%s*%/%s*")
remove_temp("^%s*%/%s*")
if with_text ~= "" then with_needed = false end
elseif mw.ustring.find(temp, "^%s*%+%s*") then
elseif mw.ustring.find(temp, "^%s*%+%s*") then
append(" ''and" .. with_text .. "'' ")
append(" ''and'' ")
remove_temp("^%s*%+%s*")
remove_temp("^%s*%+%s*")
if with_text ~= "" then with_needed = false end
else
else
if mw.ustring.sub(temp, 1, 1) == "&" then
temp = mw.ustring.sub(temp, 2)
elseif with_needed then
append("''with'' ")
with_needed = false
end
local function glossary(form, colour)
local function glossary(form, colour)
if data[form] then
if data[form] then