Skip to content

Commit dfd8b63

Browse files
committed
Thematic breaks and block quotes
1 parent 7536e14 commit dfd8b63

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

src/lib/markdown.tsx

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,14 @@ export function Markdown({ content }: { content: string }) {
4949
return <div className="text-gray-700">{renderChildren(node)}</div>;
5050
}
5151

52+
// Handle block quotes.
53+
case "blockquote":
54+
return (
55+
<blockquote className="border-l-4 border-gray-300 pl-4 text-gray-700 italic">
56+
{node.children.map(renderNode)}
57+
</blockquote>
58+
);
59+
5260
// Handles links in markdown [text](url).
5361
case "link":
5462
return <a href={node.url}>{renderChildren(node)}</a>;
@@ -87,6 +95,10 @@ export function Markdown({ content }: { content: string }) {
8795
case "inlineCode":
8896
return <p>{node.value}</p>;
8997

98+
// Handle thematic breaks.
99+
case "thematicBreak":
100+
return <hr className="my-4 border-gray-300" />;
101+
90102
default:
91103
return renderChildren(node);
92104
}

0 commit comments

Comments
 (0)