fix: 无法显示 QM 歌单中的特殊字符 - #141
Open
PhantomPixel-0418 wants to merge 1 commit into
Open
Conversation
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.
改动类型
是否包含破坏性变更
改动说明
QM(QQ 音乐)接口返回的文本字段(歌单名、歌曲名、专辑名、歌手名、创建者、描述等)中可能包含 HTML 实体编码,如
&、 、😀(emoji 的十六进制实体)等,直接透传到 UI 会导致原始编码字符串显示出来,影响阅读体验。core/config.ts:新增decodeName()工具函数,基于he库实现通用 HTML实体反转义(支持所有命名实体、十进制和十六进制数字实体),同步在
formatSingerName()中应用song_list/search/album/artist/leaderboard/song_info)中所有字符串字段统一经decodeName处理新增
he依赖(^1.2.0)及对应类型声明。测试情况
去搜索里随便搜一个 要是 QM 的 基本上往下划一划就可以发现带 emoji 或其他的一些
截图 / 录屏
自查清单
pnpm format,并确认pnpm typecheck、pnpm lint通过pnpm build:native验证;未手写native/*/index.d.tsdev分支提交