Repository navigation
修复中文字幕在小数和科学计数法中间断行 - #30
Merged
EveningStudy merged 2 commits intoNov 24, 2026
Merged
Conversation
Codex Review Summary: ✅ CompletedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
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.
解决的问题
中文台词没有空格,导出 SRT 时,原来的断行器可能从数字中间切开一行。例如使用默认的 22 字行宽导出「我们测得阿伏伽德罗常数约为6.02214076×10²³每摩尔」,第一行结尾是「6.0221407」,第二行从「6×10²³」开始。录音时长和带正负号的分贝数也可能遇到相同的问题。
改动范围
在含汉字的字幕行中,若整数、小数或科学计数表达式能完整放入一行,遇到行界就把它整体移到下一行。超出整行宽度的数值继续按原规则折行,避免超宽。加入了 ASCII 与 Unicode 负号、过长数字、英文、SRT 时码和 LRC 导出的回归用例,并更新中英文变更记录。
验证结果
pytest tests/test_subtitles.py,23 项全部通过。macOS 中 20 项通过,另 3 项触发应用的平台检查。本地未运行整个项目测试套件。风险边界
只影响字幕显示时的断行位置。沿用现有行宽上限、纯英文的文本换行和超长数值回退。安装器、下载源、模型或其他依赖、设置与项目格式、网络请求、凭据和 GPU 处理均无变更。Windows 上的实际运行由上游 CI 核验。
界面改动
不适用。