mirror of
https://github.com/paperclipai/paperclip.git
synced 2026-11-11 05:11:49 +01:00
Convert advisory html images before editor mount
This commit is contained in:
1 parent
de4432c3ec
commit
92ce9cd61c
2 files changed
-5
No files matched your search
@@ -126,8 +126,6 @@ vi.mock("@mdxeditor/editor", async () => {
|
||||
markdownShortcutPlugin: () => ({}),
|
||||
quotePlugin: () => ({}),
|
||||
realmPlugin: (plugin: unknown) => plugin,
|
||||
jsxPlugin: () => ({}),
|
||||
GenericJsxEditor: () => null,
|
||||
tablePlugin: () => ({}),
|
||||
thematicBreakPlugin: () => ({}),
|
||||
};
|
||||
|
||||
@@ -505,7 +505,6 @@ export const MarkdownEditor = forwardRef<MarkdownEditorRef, MarkdownEditorProps>
|
||||
const [isDragOver, setIsDragOver] = useState(false);
|
||||
const [richEditorError, setRichEditorError] = useState<string | null>(null);
|
||||
const dragDepthRef = useRef(0);
|
||||
const suppressHtmlProcessing = /<img\s/i.test(value);
|
||||
|
||||
// Stable ref for imageUploadHandler so plugins don't recreate on every render
|
||||
const imageUploadHandlerRef = useRef(imageUploadHandler);
|
||||
@@ -1056,11 +1055,9 @@ export const MarkdownEditor = forwardRef<MarkdownEditorRef, MarkdownEditorProps>
|
||||
onPasteCapture={handlePasteCapture}
|
||||
>
|
||||
<MDXEditor
|
||||
key={suppressHtmlProcessing ? "mdxeditor-no-html" : "mdxeditor-default"}
|
||||
ref={setEditorRef}
|
||||
markdown={editorValue}
|
||||
placeholder={placeholder}
|
||||
suppressHtmlProcessing={suppressHtmlProcessing}
|
||||
onChange={(next) => {
|
||||
const echo = echoIgnoreMarkdownRef.current;
|
||||
if (echo !== null && next === echo) {
|
||||
|
||||
Reference in new issue
Block a user