or;
		return `<c.${key}>${text.replace("\n", "").trim()}</c>`;
	}
	);
	subtitles = subtitles.replace(/<br\s*\/?>/g, "\n");

	let vttSubtitles = VTT_HEAD;

	if (Object.keys(colorMap).length) {
	let vttStyles = "";

	for (let cssClass in colorMap) {
		let color = colorMap[cssClass];
		// add cue style declaration
		vttStyles += `::cue(.${cssClass}) {color: ${color};}\n`;
	}
	vttSubtitles += vttStyles;
	}
	vttSubtitles += "\n"; // an empty line MUST separate styles from subs
	vttSubtitles += subtitles;

	retur