[BUG] Unescaped caption text breaks WebVTT and SMPTE-TT output
Caption text <BOB> & HI is written without escaping: WebVTT loses <BOB> when rendered, and SMPTE-TT produces invalid XML. Both commands exit with status 0.
Tested: Linux x86_64, CCExtractor 0.96.5 at 6c9fc900. Regression status unknown.
Reproduce
Download markup.bin, a 77-byte RCWT sample containing that caption, then run:
ccextractor markup.bin --out=webvtt -o markup.vtt
ccextractor markup.bin --out=smptett -o markup.xml
python3 -c 'import xml.etree.ElementTree as E; E.parse("markup.xml")'
Actual result
- WebVTT: Chromium's
cue.getCueAsHTML().textContentgives& HI; the literal<BOB>is treated as a tag. - SMPTE-TT: output contains
<span><BOB> & HI. XML parsing fails:not well-formed (invalid token): line 20, column 21. - Control: transcript output preserves the full caption. A
HELLO WORLDsample produces parseable XML.
Sample generator and control · Generated WebVTT · Generated XML
Expected
Preserve <BOB> & HI as visible text and produce valid XML. Escape literal caption characters, e.g. <BOB> & HI, without escaping encoder-generated formatting.
Related: #1703 proposed escaping for SRT but was closed without merging.
Screenshot
Actual generated WebVTT parsed in a browser verification page:

Hi Harshal, are you already preparing the fix? I'd like to help with a coordinated regression-test scope if that would be useful.
I read the encoders at d7eb132. WebVTT writes caption characters separately from its generated italic/underline/colour tags, while SMPTE-TT processes the tagged decoder line. Tests should check that literal <BOB> & HI survives without turning the encoder's formatting tags into visible text. I also checked #1703 and #2400; the latter handles the separate credits-string bounds issue.
Could you and a maintainer delegate that test scope to me? I'd start by reproducing your sample on current master, then cover plain text, literal markup and styled captions, checking XML parsing and WebVTT cue text. I haven't built CCExtractor or run these cases yet.
Hi, I'd like to take this issue. Could you assign it to me?