Repository navigation
fix(plugin-markdown): bold ending in full-width punctuation renders bold before a CJK letter - #36968
Conversation
…old before a CJK letter The manual reader renders package docs through MarkdownImpl, whose remark chain ran remark-gfm and remark-github-blockquote-alert only. A closing `**` with full-width punctuation before it and a CJK letter after it is not right-flanking under CommonMark, so the run stayed literal asterisks. Run remark-cjk-friendly/parseOnly first in the chain, the rule the chat surface already runs, and cross-reference the two import sites (neither package depends on the other). Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01WGufzhoBbwh8URjwQHde8v
|
repo:objectstack#3 · os-support-ai · session_01WGufzesUz1Y8VZuKJRhVL8 席位核对 — ACCEPT · repo:objectstack#3 · head f0a46f2 · 2026-11-24T12:08ZL1 read of #36968 (card #36946, p1) at Against the card. The manual reader ( Controls. ASCII emphasis, code spans, backslash escapes, an alert and a GFM table all render as before. Tag names stay inside the sanitize schema ( Reach beyond the card. Dependency and changeset. Nits.
Mechanical. All-checks: 49 success · 10 expected skips · 0 failed · 0 pending. Floor checks are green, Every open finding is a nit. ACCEPT, ordinary queue landing. |
|
repo:objectstack#3 · os-support-ai · session_01WGufzhoBbwh8URjwQHde8v Landing · 2026-11-24T12:09Z · area ux-B · head
|
Requested by Yibo Wang · project thread
repo:objectstack#3 · os-support-ai · session_01WGufzhoBbwh8URjwQHde8v
Fixes #36946
Clause-②: no
Metadata-protocol: none
维护者速读
What changes
@object-ui/plugin-markdown. The docs page (ui/apps/console/src/pages/DocPage.tsx) draws the article body withMarkdownRendererfrom@object-ui/plugin-markdown, which lazy-loadsMarkdownImpl. Its remark chain was[remarkGfm, remarkAlert], so the card's premise holds.MarkdownImpl.tsxnow runsremark-cjk-friendly/parseOnlyfirst:[remarkCjkFriendly, remarkGfm, remarkAlert]. This is the rule the chat surface already runs. It goes first, as in chat'sremarkPluginsBeforeslot, so it owns the emphasis (attention) tokenizer.parseOnlybecause this renderer never serializes markdown, the reason chat's docblock gives.@object-ui/plugin-markdownadds the dependencyremark-cjk-friendlyat^2.3.4, the same range plugin-chatbot pins. The lockfile gains one importer entry and no new package: the version resolves to the snapshot plugin-chatbot already uses.components/core/types, plusi18n/reactfor chatbot). One shared exported helper would mean a new cross-package dependency: chatbot pulling in mermaid and the rehype chain, or markdown pulling in streamdown. The config shapes also differ (a streamdownPluginConfigagainst react-markdownremarkPlugins). So each package imports the plugin once, and each site's comment names the other.chatMarkdownPlugins.tschanges a comment only.strong/emphasisnodes. Those become thestrong/emelements the default schema already allows, andrehypeSanitizestill runs last in the rehype chain. A pin shows the rendered tag set for a CJK bold line is exactlydiv,p,strong. A second pin shows raw HTML with an event handler, and ajavascript:link, stay stripped inside a CJK bold run..changeset/36946-manual-reader-cjk-bold.md), patch, lists both published packages the diff touches:@object-ui/plugin-markdown(the fix) and@object-ui/plugin-chatbot(comment only).Read first, by risk:
ui/packages/plugin-markdown/src/MarkdownImpl.tsx: theremarkPluginsline and its comment block. This is the only behaviour change.ui/packages/plugin-markdown/src/markdown-render.test.tsx: the newbold next to CJK full-width punctuationdescribe.pnpm-lock.yaml: add-only, one importer entry.Two-minute verification:
pnpm --dir ui exec vitest run packages/plugin-markdown/src/markdown-render.test.tsx. Expect 24 passed. With the plugin removed fromremarkPlugins, 7 of them go red, as the ablation below shows.Tests
Tests:
@object-ui/plugin-markdowntest(6 files, 63 tests) andtype-check(tsc --noEmit && tsc -p tsconfig.test.json), pluspnpm --dir ui exec vitest run scripts/, all run on the final headf0a46f212cf.New pins, as a top-level describe in the package's existing render harness:
**关闭日期**和**解决耗时(小时)**会被清空renders both runs as strong (the card's main repro, fromcrm_service_cases.zh.md).- **每个项目一张报销单。**每个项目的费用renders strong (full-width full stop).**它跳过和拒绝什么:**已经在活动中的人renders strong (full-width colon).**投资回报率(%)**是(收入 − 成本)renders strong.div/p/strong. An event-handler attribute and ajavascript:link stay stripped inside a CJK bold run.a **bold** wordandfoo**bar**bazare bold. A closer after whitespace, a code span and backslash escapes stay literal with nostrong.> [!NOTE]alert keeps themarkdown-alert-notecallout, and one inside a GFM table cell keeps thetable. Both render strong.Red on the base, green with the fix
Before the fix, on
62692b7f8b3with only the test file added:The fix, on
f0a46f212cf:Ablation (scripts/ablation-replace.mjs, then restored)
The test imports
./MarkdownImplfrom source, so there is no dist hop to rebuild.The same 7 go red, and the 17 controls stay green.
Acceptance notes
read_package_doc/search_package_docs(card's last line) do not render markdown.packages/runtime/src/domains/mcp-package-docs.tsreturns the doc'scontentverbatim (served locale or translation) and excerpts the raw source for search hits. No emphasis parse runs there, so the CJK flanking rule does not apply. The reading client parses the markdown itself. Not changed.~~) beside full-width punctuation is outsideremark-cjk-friendlyby its own README, which points to a siblingremark-cjk-friendly-gfm-strikethroughpackage. Chat has the same scope. Not measured on any shipped manual: no reproduction, so no card. Follow-up: none.@object-ui/plugin-markdownbuilds with every bare import external, sodist/index.jsimportsremark-cjk-friendly/parseOnlyand resolves it through the new dependency. The console already bundles the same version for chat.origin/main.overlap-checkreports clean merges withorigin/mainand with the three open PRs that share a file (fix(runtime,service-print,console): the print door answers on a hosted kernel, and an absent service reads as a localized line #36845, chore: version packages #35129, fix(settings)!: offer the knowledge settings only where the knowledge service is mounted #34223).Verification
Derived gate families (dispatch-gates, 60 derived: 59 run, 1 NOT MEASURED, 0 UNRUN)
node scripts/pm/dispatch-gates.mjs --repo objectstack-ai/objectstack --ran ran.listgives✓ dispatch-gates --ran: 60 derived famil(ies) accounted for — 59 run, 1 NOT-MEASURED. The derivation names the treeobjectstack-ai/objectstackatf0a46f212cf.pnpm --dir ui exec vitest run scripts/among them (Test Files 172 passed | 2 skipped,Tests 5126 passed | 2 skipped). Exit codes were captured before any pipe.pnpm check:dual-build-cjs-loads, reason: its self-test passes (94 cases), but the scan answersPREREQUISITE NOT MET(exit 3). It reads every@objectstack/*package'sdist, and this worktree built only the plugin-markdown closure. CILint & Repo Gatesruns it.node scripts/pm/overlap-check.mjsbefore the push:VERDICT clean exit 0.@object-ui/plugin-chatbotis not tested locally: its diff is a comment only. CITest UIandType Check UIrun it.🤖 Generated with Claude Code