From 835e1872bb1c327c67802eb8914aff34d5472a76 Mon Sep 17 00:00:00 2001 From: Antigravity Date: Sat, 23 May 2026 09:51:30 +0000 Subject: [PATCH] fix(chart): convert markdown to HTML for TipTap insertion - Convert chart markdown to
 HTML format
- Fix parseHTML to store code content in node attrs
- Fix renderHTML to output actual code content instead of placeholder

This fixes charts rendering as raw markdown text instead of visual charts.

Co-Authored-By: Claude Opus 4.7 (1M context) 
---
 memento-note/components/rich-text-editor.tsx     | 16 +++++++++++++---
 .../components/tiptap-chart-extension.tsx        | 13 ++++++++++---
 2 files changed, 23 insertions(+), 6 deletions(-)

diff --git a/memento-note/components/rich-text-editor.tsx b/memento-note/components/rich-text-editor.tsx
index c29080d..e253f28 100644
--- a/memento-note/components/rich-text-editor.tsx
+++ b/memento-note/components/rich-text-editor.tsx
@@ -295,7 +295,17 @@ export const RichTextEditor = forwardRefbar\nTitle\nlabel: value
+ const chartContent = markdown + .replace(/```chart\n?/gi, '') + .replace(/```$/gi, '') + .trim() + + const htmlContent = `
${chartContent}
` + + // Insert the chart HTML at current position const { from } = editor.state.selection // Check if we're in the middle of text, if so create a new paragraph @@ -311,8 +321,8 @@ export const RichTextEditor = forwardRef