mirror of
https://github.com/ksyasuda/SubMiner.git
synced 2026-08-05 19:21:35 -07:00
fix(subtitles): collapse duplicate ASS events and decode text once
- Drop vector drawing runs (\p1...\p0) and collapse duplicate/animation-burst cue events (karaoke frames, layered shadow copies) so typeset ASS scripts stop flooding the subtitle sidebar
- Add ass-text.ts to decode ASS text once at ingestion, mirroring mpv's ass_to_plaintext (\N/\n/\h handling, unclosed braces, no \{ \} \\ escapes)
- Renderer, timing tracker, tokenizer, and tokenization cache now consume the already-decoded plain text instead of each re-deriving it, fixing mismatched cache keys for the same authored line
This commit is contained in:
@@ -1651,9 +1651,11 @@ test('tokenizeSubtitle clears JLPT level from standalone Yomitan particle token'
|
||||
assert.equal(result.tokens?.[0]?.jlptLevel, undefined);
|
||||
});
|
||||
|
||||
test('tokenizeSubtitle returns null tokens for empty normalized text', async () => {
|
||||
test('tokenizeSubtitle returns the normalized text when it comes out empty', async () => {
|
||||
// Handing back the original would push whatever normalization dropped into app state
|
||||
// as if it were subtitle text.
|
||||
const result = await tokenizeSubtitle(' \\n ', makeDeps());
|
||||
assert.deepEqual(result, { text: ' \\n ', tokens: null });
|
||||
assert.deepEqual(result, { text: '', tokens: null });
|
||||
});
|
||||
|
||||
test('tokenizeSubtitle normalizes newlines before Yomitan parse request', async () => {
|
||||
|
||||
Reference in New Issue
Block a user