Module:Taxonbar/exists

From blackwiki
< Module:Taxonbar
Revision as of 12:50, 12 November 2019 by blackwiki>Tom.Reding (Fix escapes)
Jump to navigation Jump to search
local p = {}

function p.check( frame )
	local pagename = mw.title.getCurrentTitle().baseText
	local content = mw.title.new(pagename):getContent() or ''
	local found = string.match(content, '(?<!%<%-%-[^%<%>]*)%{%{%s*[Tt]axon?[ _-]?[bB]ar(?=%s*[%|%}])(?![^%<%>]*?%-%-%>)') or --5 redirects as of 2019/9
				  string.match(content, '(?<!%<%-%-[^%<%>]*)%{%{%s*[Tt]axonIds'   ..   '(?=%s*[%|%}])(?![^%<%>]*?%-%-%>)')
	if found then return true end
	return false
end

return p