diff --git a/packages/admin/src/components/Editor/index.tsx b/packages/admin/src/components/Editor/index.tsx index f8261675f..59335e344 100644 --- a/packages/admin/src/components/Editor/index.tsx +++ b/packages/admin/src/components/Editor/index.tsx @@ -27,6 +27,11 @@ import { Heading } from './plugins/heading'; import { customCodeBlock } from './plugins/codeBlock'; import { LinkTarget } from './plugins/linkTarget'; +const sanitize = (schema) => { + schema.protocols.src.push('data') + return schema +} + export default function EditorComponent(props: { value: string; onChange: (string: string) => void; @@ -65,7 +70,7 @@ export default function EditorComponent(props: { plugins={plugins} onChange={props.onChange} locale={cn} - + sanitize={sanitize} uploadImages={async (files: File[]) => { setLoading(true); const res = []; diff --git a/packages/website/components/Markdown/index.tsx b/packages/website/components/Markdown/index.tsx index cce347d61..b29473852 100644 --- a/packages/website/components/Markdown/index.tsx +++ b/packages/website/components/Markdown/index.tsx @@ -22,9 +22,12 @@ const plugins = [ LinkTarget(), Heading(), ] - +const sanitize = (schema) => { + schema.protocols.src.push('data') + return schema +} export default function ({ content }: { content: string }) { return
- +
}