mirror of
https://github.com/readest/readest.git
synced 2026-10-19 10:13:29 +00:00
* fix(reader): highlight quoted dialogue longer than 500 characters Dialogue highlighting capped every paired quote at 500 characters, so a longer speech in “”, „“, "", «», 「」 or 『』 was left untinted. Each pair already stops at its next opening mark (ASCII "" at the end of the block), so an unclosed quote can't swallow the next one without the cap; it is removed for those pairs. ‘’ keeps its 300-character cap: a mis-curled apostrophe (‘80s) opens a quote that nothing closes. Verified: "wraps a quote longer than 500 characters" fails on main with `expected [ '“', '"' ] to deeply equal [ …(6) ]` and passes with the fix, as does the rest of dialogue-highlight.test.ts (38 tests). In the web build (pnpm dev-web, Chromium), an EPUB with the reporter's text (a 619-character “” quote and a « » one) had only the short quote highlighted on main; with the fix all three are. Reported by noideaforeal on GitHub (#6811). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * fix(reader): highlight nested quotes within a paragraph and cap quotes at 2048 characters (owner: allow nesting only inside one paragraph, with a safe belt like 2048 chars) A speech that quotes something in the same marks (“… my spiritual “children”; in my little dog, Lizoo.”) only had the inner quote highlighted: each “ stops the scan for the previous one. A second pattern now matches an outer “”, „“ or «» quote that holds complete inner pairs, and the existing overlap pass keeps the outer region. It doesn't cross a paragraph break, where an unclosed “ usually opens the next paragraph of a long speech. Every quote is also capped at 2048 characters, in case a malformed book pairs two marks pages apart. A rejected match is rescanned from the next character, so quotes inside it are still found. Verified: in dialogue-highlight.test.ts, "wraps a quote holding inner quotes in the same marks" fails on main and on the previous commit (expected [ '“children”', '« le chef »' ] to deeply equal [ …(2) ]); "skips a quote longer than 2048 characters but keeps quotes inside it" fails on the previous, uncapped commit (expected [ Array(1) ] to deeply equal [ '«oui»' ]); "does not nest quotes across paragraphs" guards the paragraph limit. 41/41 pass. pnpm lint is clean. The reporter's sample EPUB in the web build (pnpm dev-web, Chromium): main highlights only “children”; with the fix both the 621-character quote and the whole nested speech are highlighted. Reported by noideaforeal on GitHub (#6811). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com> |
||
|---|---|---|
| .. | ||
| .agents | ||
| .claude | ||
| bench | ||
| data/wordlens | ||
| docs | ||
| e2e | ||
| extensions | ||
| public | ||
| scripts | ||
| src | ||
| src-tauri | ||
| workers | ||
| .env | ||
| .env.local.example | ||
| .env.tauri | ||
| .env.tauri.example | ||
| .env.web | ||
| .env.web.example | ||
| .gitignore | ||
| AGENTS.md | ||
| CLAUDE.md | ||
| components.json | ||
| DESIGN.md | ||
| i18n-langs.json | ||
| i18next-scanner.config.cjs | ||
| LESSONS.md | ||
| next.config.mjs | ||
| open-next.config.ts | ||
| package.json | ||
| pdfjs.d.ts | ||
| playwright.config.ts | ||
| postcss.config.mjs | ||
| PRODUCT.md | ||
| raw-loader.d.ts | ||
| release-notes.json | ||
| skills-lock.json | ||
| TODOS.md | ||
| tsconfig.json | ||
| vite.config.ts | ||
| vitest.android.config.mts | ||
| vitest.browser.config.mts | ||
| vitest.config.mts | ||
| vitest.env.mts | ||
| vitest.setup.ts | ||
| vitest.tauri.config.mts | ||
| vitest.tauri.setup.ts | ||
| wdio.conf.ts | ||
| worker.ts | ||
| wrangler.toml | ||