Repository navigation
fix(client): render fences whose label carries trailing punctuation - #335
Merged
Merged
Conversation
A fence written as ```dsh-ui> (one stray `>` after the language tag) never renders: the host's mdast keeps the tag verbatim, so the snapshot language is `dsh-ui>` rather than `dsh-ui`, and the takeover check falls through to the generic code-block path. Nothing warns — the reply just shows raw JSON. A single real session held 182 such fences. Normalize the label before every comparison instead: trim, ignore case, and strip trailing punctuation from the tag. Four decisions share the resolver (candidate discovery, ordinal counting, takeover, diagnostic rebuild) so a fence cannot be found by one and rejected by another. Labels that merely start with `dsh-ui` (`dsh-ui-special`) are left alone, and the null/undefined distinction the content-fallback relies on is preserved. Also teach the fence label rule in SKILL.md, with the failure table.
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.
当模型把围栏语言写成
dsh-ui>或DSH-UI时,原先可能只显示代码块,且没有纠错反馈。本改动统一客户端发现、首次接管、后续维护、围栏编号及服务端纠错的语言识别,让这些容错写法完整生效。dsh-ui-special、dsh-ui-dark、JSON 和普通代码保持各自语义。验证:Node 24 下
npm run check通过(100 个文件、1297 项测试,含类型、构建与独立导出检查);verify-pack通过(2.61 MB / 8.60 MB)。新增真实 DOM 与服务端回归在修复前出现 8 项预期失败,修复后通过。已合入当前 main 的输入框隔离和 Mermaid 字体修复,未发布 npm 版本。