review(copilot): clarify table-rule rationale (UTF-16 code units, not graphemes)

This commit is contained in:
Brooklyn Nicholson 2026-04-28 15:29:11 -05:00
parent 9eabc24e24
commit 4689ace7cb

View file

@ -99,10 +99,11 @@ const renderTable = (k: number, rows: string[][], t: Theme) => {
// Thin divider under the header. Without it tables look like prose // Thin divider under the header. Without it tables look like prose
// with extra spacing because the header is just amber-coloured text // with extra spacing because the header is just amber-coloured text
// (#15534). We avoid full borders on purpose — column widths are // (#15534). We avoid full borders on purpose — column widths come
// grapheme-approximate so a real outline often misaligns; one dim // from `stripInlineMarkup(...).length` (UTF-16 code units, not
// dashed rule under row 0 plus tab-style column gaps reads cleanly // display width), so a real outline often misaligns on emoji and
// on every terminal we tested. // East-Asian wide characters; one dim dashed rule under row 0 plus
// tab-style column gaps reads cleanly on every terminal we tested.
const sep = widths.map(w => '─'.repeat(Math.max(1, w))).join(' ') const sep = widths.map(w => '─'.repeat(Math.max(1, w))).join(' ')
return ( return (