Skip to content

Telegram: bold with CJK punctuation inside closing ** renders as literal asterisks (CommonMark flanking vs CJK) #101120

Description

@j08577600-jpg

Summary

When an agent reply contains bold written as **标题:**内容 (full-width CJK punctuation immediately inside the closing **, followed by more text), the Telegram channel delivers the message with literal ** instead of bold. Other bold spans in the same message render fine, so messages arrive half-formatted.

Environment

  • OpenClaw 2026.6.10 (aa69b12), also reproduced against the published dist of 2026.6.11 and 2026.7.1-beta.2 (same markdown-it bundle)
  • Telegram channel, richMessages: true, local telegram-bot-api server

Reproduction

Input markdown (very common pattern for Chinese LLM output — inline bold labels):

边界:**社区显示:**Fable 与 **有效**。

Actual HTML produced by the Telegram rich-message renderer (captured on the wire to the bot API):

边界:**社区显示:**Fable 与 <b>有效</b>。

The first pair of ** is left literal; the second converts correctly.

Root cause

The markdown→HTML conversion uses markdown-it with strict CommonMark emphasis rules. Per the CommonMark flanking rules, a closing ** that is preceded by punctuation (full-width ":", "。", "、", ")" etc. are Unicode punctuation) must be followed by whitespace or punctuation to be right-flanking. In CJK text there are no inter-word spaces, so the extremely common pattern **标签:**正文 never qualifies and the delimiters stay literal.

This is the well-known CommonMark-vs-CJK emphasis problem. Chinese/Japanese/Korean model output hits it constantly because LLMs love the **label:** text idiom.

Suggested fix

Wire markdown-it-cjk-friendly (implements the CJK-friendly flanking amendment proposed for CommonMark) into the markdown-it instance used for outbound channel formatting — or apply an equivalent pre-pass before emphasis parsing. This would fix bold/italic rendering for CJK users across all channels that go through the shared renderer, not just Telegram.

Happy to provide more captures if useful.

Metadata

Metadata

Assignees

No one assigned

    Labels

    P2Normal backlog priority with limited blast radius.clawsweeper:fix-shape-clearClawSweeper found a clear likely implementation shape for this issue.clawsweeper:queueable-fixClawSweeper marked this issue as an existing queue_fix_pr work candidate.clawsweeper:source-reproClawSweeper found a high-confidence source-level issue reproduction.impact:otherThis issue has meaningful maintainer-visible impact outside the owned taxonomy.issue-rating: 🦞 diamond lobsterVery strong issue quality with high-confidence source-level or clear reproduction.no-staleExclude from stale automation

    Type

    No type

    Fields

    Priority

    None yet

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions