From 2eb3b0a9c8166eaab73ed210cd3c82fb6f1ceb99 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=81lvaro=20Velad=20Galv=C3=A1n?= Date: Tue, 16 Sep 2025 16:38:38 +0200 Subject: [PATCH] fix(WebVTT): Fix lines starting with spaces don't break correctly (#9100) This only happens when there are multiple line breaks. --- lib/text/cue.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/text/cue.js b/lib/text/cue.js index a8994f85f..494229eec 100644 --- a/lib/text/cue.js +++ b/lib/text/cue.js @@ -435,7 +435,7 @@ shaka.text.Cue = class { cue.payload = ''; - const xmlPayload = '' + payload.replace('\n', '
') + '
'; + const xmlPayload = '' + payload.replace(/\n/g, '
') + '
'; let element; try { element = TXml.parseXmlString(xmlPayload, 'span');