Skip to content

Commit edd6f27

Browse files
committed
fix(cli): handle bold and italic formatting in markdown lists
- Add handlers for strong and emphasis nodes in markdown renderer - Remove debug logging from message block rendering
1 parent fb60dcb commit edd6f27

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

cli/src/utils/markdown-renderer.tsx

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,14 @@ import type {
77
Blockquote,
88
Code,
99
Content,
10+
Emphasis,
1011
Heading,
1112
InlineCode,
1213
List,
1314
ListItem,
1415
Paragraph,
1516
Root,
17+
Strong,
1618
Text,
1719
} from 'mdast'
1820

@@ -96,6 +98,12 @@ function nodeToPlainText(node: Content | Root): string {
9698
case 'inlineCode':
9799
return `\`${(node as InlineCode).value}\``
98100

101+
case 'strong':
102+
return (node as Strong).children.map(nodeToPlainText).join('')
103+
104+
case 'emphasis':
105+
return (node as Emphasis).children.map(nodeToPlainText).join('')
106+
99107
case 'heading': {
100108
const heading = node as Heading
101109
const prefix = '#'.repeat(Math.max(1, Math.min(heading.depth, 6)))

0 commit comments

Comments
 (0)