Модуль:Песочница/Jack who built the house/Is disambiguation

Материал из Википедии — свободной энциклопедии
Перейти к навигации Перейти к поиску
Документация
local p = {}

function p.main(frame)
	local getArgs = require('Модуль:Arguments').getArgs
	local args = getArgs(frame)
	local title = mw.title.new(args[1])
	local disambig = false
	if title.exists then
		local fullContent = title:getContent()
		processedContent = frame:preprocess(
			fullContent
			:gsub('<noinclude>', '')
			:gsub('</noinclude>', '')
			:gsub('<onlyinclude>', '')
			:gsub('</onlyinclude>', ''))
		if processedContent:match('id="disambig"') then
			disambig = true
		end
	end
	return disambig
end

return p