2,788
edits
No edit summary |
No edit summary |
||
Line 30: | Line 30: | ||
local function process_category(category_name, p_lua, p_categories) | local function process_category(category_name, p_lua, p_categories) | ||
local out = "" | local out = "" | ||
local is_s, _, s_match = mw.ustring.find(category_name, p_lua) | local is_s = mw.ustring.find(category_name, "%(%.%.%-%)") ~= nil | ||
local _, _, s_match = mw.ustring.find(category_name, p_lua) | |||
for _, p_category in ipairs(p_categories) do | for _, p_category in ipairs(p_categories) do | ||
out = out .. "[[Category:" .. (is_s | out = out .. "[[Category:" .. (is_s and tostring(mw.ustring.gsub(p_category, "%%s", s_match)) or p_category) .. "]]" | ||
end | end | ||
return out | return out |