-
-
Notifications
You must be signed in to change notification settings - Fork 80.7k
Markdown table columns misaligned with CJK characters on Telegram and Discord #55512
Copy link
Copy link
Closed
BingqingLyu/openclaw
#1490Labels
P2Normal backlog priority with limited blast radius.Normal backlog priority with limited blast radius.clawsweeper:linked-pr-openClawSweeper found an open linked pull request for this issue.ClawSweeper found an open linked pull request for this issue.clawsweeper:no-new-fix-prClawSweeper does not recommend queueing a new automated fix PR for this issue.ClawSweeper does not recommend queueing a new automated fix PR for this issue.clawsweeper:source-reproClawSweeper found a high-confidence source-level issue reproduction.ClawSweeper found a high-confidence source-level issue reproduction.impact:otherThis issue has meaningful maintainer-visible impact outside the owned taxonomy.This 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.Very strong issue quality with high-confidence source-level or clear reproduction.maturity:stableIssue affects a taxonomy feature currently scored M4/M5.Issue affects a taxonomy feature currently scored M4/M5.staleMarked as stale due to inactivityMarked as stale due to inactivity
Description
Metadata
Metadata
Assignees
Labels
P2Normal backlog priority with limited blast radius.Normal backlog priority with limited blast radius.clawsweeper:linked-pr-openClawSweeper found an open linked pull request for this issue.ClawSweeper found an open linked pull request for this issue.clawsweeper:no-new-fix-prClawSweeper does not recommend queueing a new automated fix PR for this issue.ClawSweeper does not recommend queueing a new automated fix PR for this issue.clawsweeper:source-reproClawSweeper found a high-confidence source-level issue reproduction.ClawSweeper found a high-confidence source-level issue reproduction.impact:otherThis issue has meaningful maintainer-visible impact outside the owned taxonomy.This 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.Very strong issue quality with high-confidence source-level or clear reproduction.maturity:stableIssue affects a taxonomy feature currently scored M4/M5.Issue affects a taxonomy feature currently scored M4/M5.staleMarked as stale due to inactivityMarked as stale due to inactivity
Type
Fields
Priority
None yet
Description
Markdown tables containing CJK (Chinese/Japanese/Korean) characters are rendered with misaligned columns on both Telegram and Discord channels.
Problem
<pre>blocks, but column padding usesString.lengthinstead of display width. CJK characters occupy 2 terminal columns but are counted as 1, causing all subsequent columns to shift left.|) syntax. Discord does not support GFM tables natively, so the table renders as plain broken text.Example
A table like:
Renders misaligned on Telegram because "类型" (2 chars, 4 display columns) is padded as if it were 2 display columns.
On Discord, the table is not rendered at all — raw pipes and dashes are shown.
Expected Behavior
string-widthnpm package or equivalent) when padding table cells in<pre>blocks.Environment
Screenshots
Telegram table rendering with misaligned CJK columns:
The columns after CJK text are shifted left because each CJK character is only counted as width 1 instead of width 2.
References
string-widthpackage handles this correctly: https://github.com/sindresorhus/string-width