local p = {}

local function _main(args)
	if mw.title.getCurrentTitle().namespace == 0 then
		return error("Talk quote inline is only for quoting in talk and project pages. Do not use it in actual articles")
	end

	local title = ""
	if args.title then
		title = "title=" .. args.title
	end

	local italic = ""
	if args.i or args.italic then
		italic = "inline-quote-talk-italic"
	end

	local quotes = ""
	if args.q or args.quotes then
		quotes = "inline-quote-talk-marks"
	end

	local text = args[1] or "Example text"
	local formatted_text = '<q %s class="inline-quote-talk %s %s">%s</q>'
	formatted_text = string.format(formatted_text, title, italic, quotes, text)
	formatted_text = string.gsub(formatted_text, "%s+", " ")

	return formatted_text
end

function p.main(frame)
	local getArgs = require("Module:Arguments").getArgs
	local args = getArgs(frame)
	return _main(args)
end

return p