Module:auto cat: Difference between revisions

Jump to navigation Jump to search
ਕੋਈ ਸੋਧ ਸਾਰ ਨਹੀਂ
No edit summary
No edit summary
Line 123: Line 123:
             hydrate_pattern_p(out_patterns, p_lua, p_categories)
             hydrate_pattern_p(out_patterns, p_lua, p_categories)
         else
         else
             table.insert(out_patterns, to_pattern(capitalize(p_lua), p_categories))
             table.insert(out_patterns, to_pattern(p_lua, p_categories))
         end
         end
     end
     end
Line 134: Line 134:
     local _, _, s_match = mw.ustring.find(category_name, p_lua)
     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 and replace(p_category, {["%%s"] = s_match}) or p_category) .. "]]"
         out = out .. "[[Category:" .. (is_s and replace(p_category, {["^%%s"] = capitalize(s_match), ["%%s"] = s_match}) or p_category) .. "]]"
     end
     end
     return out
     return out

Navigation menu