Commit c71442a
fix(gchat): use full markdown parser for card text rendering (#92)
* fix(gchat): use full markdown parser for card text rendering
The _markdown_to_gchat helper only converted **bold** to *bold* via a
naive regex, leaving markdown bullet lists and italic syntax as raw
literals in textParagraph widgets. Google Chat does not render markdown
list syntax (- item, * item), so agent responses with bullet lists
appeared with literal * characters instead of formatted bullets.
Replace _markdown_to_gchat with _render_markdown_as_gchat which
round-trips content through parse_markdown + GoogleChatFormatConverter,
the same path used for plain text messages. This correctly converts:
- markdown lists -> bullet characters
- **bold** -> *bold* (GChat bold)
- *italic* -> _italic_ (GChat italic)
Apply the fix to both _convert_text_to_widget and
_convert_fields_to_widgets. Update the test that asserted old
pass-through behavior for *italic* to reflect the correct output.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
* fix(gchat): restore muted style handling dropped in markdown converter refactor
Upstream TS convertTextToWidget explicitly reverts muted elements to
plain emoji-only text, bypassing markdown conversion. The AST-converter
refactor dropped the elif branch, causing muted card text to go through
parse_markdown + GoogleChatFormatConverter.from_ast instead.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
---------
Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>1 parent a3133c7 commit c71442a
2 files changed
Lines changed: 34 additions & 20 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
10 | 10 | | |
11 | 11 | | |
12 | 12 | | |
| 13 | + | |
13 | 14 | | |
14 | 15 | | |
15 | 16 | | |
| |||
18 | 19 | | |
19 | 20 | | |
20 | 21 | | |
| 22 | + | |
21 | 23 | | |
22 | 24 | | |
23 | 25 | | |
24 | 26 | | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
25 | 34 | | |
26 | 35 | | |
27 | 36 | | |
| |||
148 | 157 | | |
149 | 158 | | |
150 | 159 | | |
151 | | - | |
152 | | - | |
153 | | - | |
154 | | - | |
155 | | - | |
156 | | - | |
157 | | - | |
158 | | - | |
159 | | - | |
160 | | - | |
161 | 160 | | |
162 | 161 | | |
163 | | - | |
| 162 | + | |
164 | 163 | | |
165 | | - | |
166 | | - | |
| 164 | + | |
167 | 165 | | |
168 | | - | |
169 | | - | |
| 166 | + | |
170 | 167 | | |
171 | 168 | | |
172 | 169 | | |
| |||
302 | 299 | | |
303 | 300 | | |
304 | 301 | | |
305 | | - | |
306 | | - | |
| 302 | + | |
| 303 | + | |
307 | 304 | | |
308 | 305 | | |
309 | 306 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
304 | 304 | | |
305 | 305 | | |
306 | 306 | | |
307 | | - | |
308 | | - | |
| 307 | + | |
| 308 | + | |
| 309 | + | |
| 310 | + | |
309 | 311 | | |
310 | 312 | | |
311 | | - | |
| 313 | + | |
312 | 314 | | |
313 | 315 | | |
314 | 316 | | |
| |||
330 | 332 | | |
331 | 333 | | |
332 | 334 | | |
| 335 | + | |
| 336 | + | |
| 337 | + | |
| 338 | + | |
| 339 | + | |
| 340 | + | |
| 341 | + | |
| 342 | + | |
| 343 | + | |
| 344 | + | |
| 345 | + | |
| 346 | + | |
| 347 | + | |
| 348 | + | |
| 349 | + | |
333 | 350 | | |
334 | 351 | | |
335 | 352 | | |
| |||
0 commit comments