@nomercy-entertainment/nomercy-video-player 2.9.0 → 2.9.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md
CHANGED
|
@@ -1593,11 +1593,11 @@ export class Html5VideoBackend extends MediaElementBackend {
|
|
|
1593
1593
|
// Cue normalisation
|
|
1594
1594
|
// ─────────────────────────────────────────────────────────────────────────
|
|
1595
1595
|
/**
|
|
1596
|
-
*
|
|
1597
|
-
*
|
|
1596
|
+
* Keep only `<i>`, `<b>`, `<u>` so consumers never re-sanitise; same rule as
|
|
1597
|
+
* core's `parseVttSubtitles`. A `<` that could still open a tag is dropped.
|
|
1598
1598
|
*/
|
|
1599
|
-
const
|
|
1600
|
-
const
|
|
1599
|
+
const NON_INLINE_TAG_RE = /<(?!\/?[ibu]>)[^<>]*>/gi;
|
|
1600
|
+
const STRAY_TAG_OPEN_RE = /<(?!\/?[ibu]>)(?=[a-z/!?])/gi;
|
|
1601
1601
|
const ALL_TAG_RE = /<[^>]+>/g;
|
|
1602
1602
|
/**
|
|
1603
1603
|
* Translate a native `VTTCue` into the backend-agnostic `SubtitleCue`
|
|
@@ -1630,7 +1630,7 @@ function mergeCaptionRows(rows) {
|
|
|
1630
1630
|
}
|
|
1631
1631
|
function normaliseVttCue(cue) {
|
|
1632
1632
|
const raw = cue.text ?? '';
|
|
1633
|
-
const safe = raw.replace(
|
|
1633
|
+
const safe = raw.replace(NON_INLINE_TAG_RE, '').replace(STRAY_TAG_OPEN_RE, '');
|
|
1634
1634
|
const plain = safe.replace(ALL_TAG_RE, '').trim();
|
|
1635
1635
|
// `cue.line` is either a number or 'auto'. `cue.snapToLines` decides
|
|
1636
1636
|
// whether that number is a LINE INDEX (CEA-608 style: line:1 = top
|