Module:Article stub box: Difference between revisions

Content deleted Content added
m broken image cat
hidden chars won't cause false categorization; bug involving E and W sortkey
Line 94:
--Check category existance only if on the template page (i.e. stub documentation)
if page then
cat = mw.ustring.gsub(cat, '[^%w%p%s]', '')--remove hidden unicode chars before checks
if not mw.title.new('Category:' .. cat).exists then
code = code or mw.html.create'code':wikitext'|category'
Line 106 ⟶ 107:
table.insert(stubCats.v, v == '' and not p.demo and pageDoc.exists and
'Stub message templates with documentation subpages'
or not string.cat:match(cat, ' stubs$') and {k = 'S', t = page.text}
)
end
Line 270 ⟶ 271:
output:wikitext(p.templatepage(frame, page))
elseif not page.isSubpage and page.namespace == 10 then-- Template namespace and not a subpage
category{{k = args.name and 'E' or 'W', t = page.text}}
end
end