extensions/notebook-renderers/src/ansi.ts/appendStylizedStringToContainer
export function appendStylizedStringToContainer(
	root: HTMLElement,
	stringContent: string,
	cssClasses: string[],
	workspaceFolder: string | undefined,
	customTextColor?: RGBA | string,
	customBackgroundColor?: RGBA | string,
	customUnderlineColor?: RGBA | string
): void {
	if (!root || !stringContent) {
		return;
	}

	const container = linkify(stringContent, true, workspaceFolder);

	container.className = cssClasses.join(' ');
	if (customTextColor) {
		container.style.color = typeof customTextColor === 'string' ? customTextColor : Color.Format.CSS.formatRGB(new Color(customTextColor));
	}
	if (customBackgroundColor) {
		container.style.backgroundColor = typeof customBackgroundColor === 'string' ? customBackgroundColor : Color.Format.CSS.formatRGB(new Color(customBackgroundColor));
	}
	if (customUnderlineColor) {
		container.style.textDecorationColor = typeof customUnderlineColor === 'string' ? customUnderlineColor : Color.Format.CSS.formatRGB(new Color(customUnderlineColor));
	}
	root.appendChild(container);
}