Module:Ns has subpages: Difference between revisions

match whitespace and underscores
(tweak the string matching)
(match whitespace and underscores)
Line 20:
-- thing as {{NAMESPACE}} in most cases.
if not nsTable and type(ns) == 'string' and not ns:find('[<>|%[%]{}]') then
local nsStripped = ns:gsub('^[_%s]*:', '')
nsStripped = nsStripped:gsub(':.*$', '')
nsTable = mw.site.namespaces[nsStripped]
Anonymous user