Repository navigation
fix(client): autoInit 容器选择器排除 script 标签(QA #12 缺陷⑤) - #21
Merged
todosdev[bot] merged 2 commits intoNov 18, 2026
Merged
Conversation
added 2 commits
November 18, 2026 11:49
Prevent autoInit and CalineWidget fallback from targeting script tags bearing data-caline.
…b-718e-8253-12b36914e343
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.
Summary
autoInit与CalineWidget构造器回退中,容器选择器[data-caline]误将带有data-caline属性的<script>标签作为挂载容器的问题。<script>元素后自动插入<div id="caline">进行挂载,不再导致报错崩溃。Changes
client/src/index.ts:autoInit: 探测显式容器选择器从[data-caline], #caline修正为[data-caline]:not(script), #caline。CalineWidget: 构造器容器缺省回退从[data-caline]修正为[data-caline]:not(script)。client/test/widget.test.ts:<script data-caline>与<script data-caline data-server-url>两类用法无显式容器时的防崩与自动创建容器单测。<div data-caline>、<div id="caline">、#comments、#waline等既有容器用法防回归单测。web/public/client/v1.js: 同步最新客户端打包产物。Testing
pnpm typecheck: 客户端、后台与 Worker 零类型错误。pnpm lint&pnpm format:check: 全部通过。pnpm test: 全模块共 58 个测试文件、442 个测试全数通过(含 client 35 个测试)。pnpm check:identity: 身份令牌校验通过,白名单外零残留。