@inceptionstack/roundhouse 0.3.23 → 0.3.24
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/src/telegram-format.ts +6 -6
package/package.json
CHANGED
package/src/telegram-format.ts
CHANGED
|
@@ -133,11 +133,11 @@ function formatTable(tableMd: string): string {
|
|
|
133
133
|
if (cp >= 0xFE00 && cp <= 0xFE0F) return 0;
|
|
134
134
|
// Tags block (used in flag sequences etc)
|
|
135
135
|
if (cp >= 0xE0001 && cp <= 0xE007F) return 0;
|
|
136
|
-
// Emoji
|
|
137
|
-
if (cp >= 0x1F100 && cp <= 0x1FAFF) return
|
|
138
|
-
if (cp >= 0x231A && cp <= 0x23FF) return
|
|
139
|
-
if (cp >= 0x2600 && cp <= 0x27BF) return
|
|
140
|
-
if (cp >= 0x2B50 && cp <= 0x2B55) return
|
|
136
|
+
// Emoji — Telegram renders these ~3 monospace columns wide in <pre> blocks
|
|
137
|
+
if (cp >= 0x1F100 && cp <= 0x1FAFF) return 3;
|
|
138
|
+
if (cp >= 0x231A && cp <= 0x23FF) return 3;
|
|
139
|
+
if (cp >= 0x2600 && cp <= 0x27BF) return 3;
|
|
140
|
+
if (cp >= 0x2B50 && cp <= 0x2B55) return 3;
|
|
141
141
|
// CJK Unified Ideographs
|
|
142
142
|
if (cp >= 0x3400 && cp <= 0x4DBF) return 2;
|
|
143
143
|
if (cp >= 0x4E00 && cp <= 0x9FFF) return 2;
|
|
@@ -155,7 +155,7 @@ function formatTable(tableMd: string): string {
|
|
|
155
155
|
const segmenter = new Intl.Segmenter();
|
|
156
156
|
const graphemeDisplayWidth = (grapheme: string): number => {
|
|
157
157
|
// ZWJ emoji sequences: multiple code points but render as a single wide emoji
|
|
158
|
-
if (grapheme.includes('\u200D')) return
|
|
158
|
+
if (grapheme.includes('\u200D')) return 3;
|
|
159
159
|
// Single code point: use lookup
|
|
160
160
|
const cps = Array.from(grapheme);
|
|
161
161
|
if (cps.length === 1) return codePointWidth(cps[0].codePointAt(0)!);
|