fix(reader): support TTS for br-only chapter content - #13
Open
beer-on-ice wants to merge 1 commit into
Open
Conversation
- fall back to the chapter root when rendered content has no paragraphs - preserve existing paragraph targets without rewriting chapter HTML - add regression coverage for br-only and paragraph content
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
问题
当前自动朗读仅从
.chapter-text p收集段落。一些书源返回的正文使用<br>分隔,没有生成任何<p>,因此段落列表为空;点击“开始”后会直接进入下一章,而不会朗读当前章节。修改
<p>时保持原来的逐段朗读逻辑不变。<p>、但正文容器包含有效文本时,将.chapter-text容器作为一个朗读目标。<br>组成的章节可以开始朗读;<p>的章节仍使用原来的段落目标。验证
npm test:20 个测试文件、74 个测试全部通过。npm run build:构建通过。<br>、0 个<p>)中验证:点击“开始”后正常进入播放状态,不再直接跳章。影响范围
仅调整前端自动朗读目标的收集逻辑,并新增对应单元测试;不涉及后端、数据库或正文缓存格式。