-- Return lines unindented by heuristic;
-- otherwise return null because:
-- * props include a multiline string
-- * text has more than one adjacent line
-- * markup does not close

function dedentLines(input: Array<string>): Array<string> | nil
	local output: Array<string> = {}

	while #output < #input do
		local line = input[#output + 1]

		if hasUnmatchedDoubleQuoteMarks(line) then
			return nil
		elseif isFirstLineOfTag(line) then
			if not dedentMarkup(input, output) then
				return nil
			end
		else
			table.insert(output, dedentLine(line))
		end
	end

	return output
end

return dedentLines
