Skip to content

fix(studio): preserve caption text when parsing transcripts - #3896

Open
AksharP5 wants to merge 1 commit into
heygen-com:mainfrom
AksharP5:fix/caption-transcript-literals
Open

fix(studio): preserve caption text when parsing transcripts#3896
AksharP5 wants to merge 1 commit into
heygen-com:mainfrom
AksharP5:fix/caption-transcript-literals

Conversation

@AksharP5

Copy link
Copy Markdown
Contributor

Caption editing can miss an entire transcript when a word contains ];. The old normalization also changes literal text such as ,] and rejects JavaScript escapes.

Use Acorn to find the array boundary and decode static data without executing the source. Text, word IDs, timing, and existing JSON/single-quoted syntax are preserved. Executable expressions and malformed input still return an empty transcript.

Fixes #3852.

Verification

  • Reproduced five regression failures on upstream before the fix. All 92 caption tests now pass, including malformed input and non-execution checks.
  • Real-browser check of parseCaptionComposition with an iframe DOM preserved x ]; y, literal ,] and ,}, hex escapes, escaped quotes, IDs, and timing. An executable initializer was rejected with zero calls.
  • Studio typecheck and build, full workspace build, oxlint, oxfmt, and the fallow diff gate pass.

Four files changed. No visual styling or layout changes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

fix: preserve caption transcripts containing delimiters and JavaScript escapes

1 participant