Module:Ns has subpages: Difference between revisions
Jump to navigation
Jump to search
Content added Content deleted
en>Mr. Stradivarius (tweak the string matching) |
en>Mr. Stradivarius (match whitespace and underscores) |
||
Line 20: | Line 20: | ||
-- thing as {{NAMESPACE}} in most cases. |
-- thing as {{NAMESPACE}} in most cases. |
||
if not nsTable and type(ns) == 'string' and not ns:find('[<>|%[%]{}]') then |
if not nsTable and type(ns) == 'string' and not ns:find('[<>|%[%]{}]') then |
||
local nsStripped = ns:gsub('^_*:', '') |
local nsStripped = ns:gsub('^[_%s]*:', '') |
||
nsStripped = nsStripped:gsub(':.*$', '') |
nsStripped = nsStripped:gsub(':.*$', '') |
||
nsTable = mw.site.namespaces[nsStripped] |
nsTable = mw.site.namespaces[nsStripped] |