-- Return empty string if children is empty.

function printChildren(
	children: Array<unknown>,
	config: Config,
	indentation: string,
	depth: number,
	refs: Refs,
	printer: Printer
): string
	return Array.join(
		Array.map(children, function(child)
			return config.spacingOuter
				.. indentation
				.. if typeof(child) == "string"
					then printText(child, config)
					else printer(child, config, indentation, depth, refs)
		end),
		""
	)
end
exports.printChildren = printChildren

function printText(text: string, config: Config): string
	-- ROBLOX deviation START: adding default value as we don't support colors
	local colors = config.colors or DEFAULT_COLORS
	local contentColor = colors.content
	-- ROBLOX deviation END
	return contentColor.open .. escapeHTML(text) .. contentColor.close
end
exports.printText = printText

function printComment(comment: string, config: Config): string
	-- ROBLOX deviation START: adding default value as we don't support colors
	local colors = config.colors or DEFAULT_COLORS
	local commentColor = colors.comment
	-- ROBLOX deviation END
	return commentColor.open .. "<!--" .. escapeHTML(comment) .. "-->" .. commentColor.close
end
exports.printComment = printComment
