Skip to content

Commit 7981695

Browse files
fix nested list item rendering
1 parent 7c46c54 commit 7981695

File tree

2 files changed

+16
-14
lines changed

2 files changed

+16
-14
lines changed

typescript/src/renderer/components/blocks/ListItemBlockRenderer.tsx

Lines changed: 15 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -30,23 +30,25 @@ export const ListItemBlockRenderer: React.FC<ListItemBlockRendererProps> = ({
3030
: "notion-numbered_list-block";
3131

3232
return (
33-
<div
34-
{...props}
35-
className={`notion-selectable ${blockClassName} ${className || ""}`.trim()}
36-
data-block-id={block.id}
37-
>
38-
{/* <div className="notion-list-item-box-left" /> */}
39-
{block.type === "bulleted_list_item" && (
40-
<div className="notion-list-item-box-left" />
41-
)}
42-
<div className="notion-list-content">
43-
<RichTextRenderer richText={listData?.rich_text || []} />
33+
<>
34+
<div
35+
{...props}
36+
className={`notion-selectable ${blockClassName} ${className || ""}`.trim()}
37+
data-block-id={block.id}
38+
>
39+
{/* <div className="notion-list-item-box-left" /> */}
40+
{block.type === "bulleted_list_item" && (
41+
<div className="notion-list-item-box-left" />
42+
)}
43+
<div className="notion-list-content">
44+
<RichTextRenderer richText={listData?.rich_text || []} />
45+
</div>
4446
</div>
4547
{/* Render children blocks recursively */}
4648
{block.children && block.children.length > 0 && (
4749
<div
4850
className="notion-block-children"
49-
style={{ marginLeft: `${depth * 24}px` }}
51+
style={{ marginLeft: `${depth + 1 * 24}px` }}
5052
>
5153
{block.children.map((child, index: number) => (
5254
<BlockRenderer
@@ -58,6 +60,6 @@ export const ListItemBlockRenderer: React.FC<ListItemBlockRendererProps> = ({
5860
))}
5961
</div>
6062
)}
61-
</div>
63+
</>
6264
);
6365
};

typescript/src/renderer/styles/index.css

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/* JSON-DOC Renderer Styles */
22

33
/* Import KaTeX styles for equations */
4-
/* @import "katex/dist/katex.min.css"; */
4+
@import "katex/dist/katex.min.css";
55

66
/* Import design tokens first */
77
@import "./variables.css";

0 commit comments

Comments
 (0)