Streamdown (#1128)

This commit is contained in:
Hayden Bleasel 2025-08-18 22:48:13 -07:00 committed by GitHub
parent 256305d19f
commit 6894189c17
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
6 changed files with 389 additions and 137 deletions

View file

@ -11,7 +11,7 @@ import { EditorState } from 'prosemirror-state';
import { EditorView } from 'prosemirror-view';
import React, { useEffect, useRef } from 'react';
import { renderToString } from 'react-dom/server';
import ReactMarkdown from 'react-markdown';
import { Streamdown } from 'streamdown';
import { diffEditor, DiffType } from '@/lib/editor/diff';
@ -60,10 +60,10 @@ export const DiffView = ({ oldContent, newContent }: DiffEditorProps) => {
const parser = DOMParser.fromSchema(diffSchema);
const oldHtmlContent = renderToString(
<ReactMarkdown>{oldContent}</ReactMarkdown>,
<Streamdown>{oldContent}</Streamdown>,
);
const newHtmlContent = renderToString(
<ReactMarkdown>{newContent}</ReactMarkdown>,
<Streamdown>{newContent}</Streamdown>,
);
const oldContainer = document.createElement('div');