Repository navigation
fix: 修复下载 TTML 歌词时被重新格式化的问题 - #270
Merged
Merged
Conversation
kid141252010
force-pushed
the
fix/download-ttml-format
branch
3 times, most recently
from
September 20, 2026 06:43
5be886d to
e68ec29
Compare
kid141252010
force-pushed
the
fix/download-ttml-format
branch
from
September 20, 2026 07:07
e68ec29 to
cb665a7
Compare
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.
改动类型
是否包含破坏性变更
改动说明
parseLyric → toTtml进行重组序列化,导致原始 TTML 中的<head>、<metadata>(如 iTunes 歌曲元数据)、命名空间及原始样式格式被全部剥离,变成了简化的重排 XML。src/utils/lyric/serialize.ts的buildDownloadLyric:当目标格式为ttml且源格式已是ttml时,直接返回原始歌词文本,避免不必要的重新格式化。关联 Issue
测试情况
.ttml文件完整保留原始元数据与排版样式;源格式为非 TTML(如 LRC/QRC)时,仍正常转换为 TTML。pnpm test:web全部通过。pnpm typecheck(node + web)检查无类型错误。pnpm lint格式与规范校验全部通过。自查清单
pnpm format,并确认pnpm typecheck、pnpm lint通过pnpm build:native验证;未手写native/*/index.d.tsdev分支提交