feat: add allowBase64 option to image extension
This commit is contained in:
@@ -6,6 +6,7 @@ import {
|
||||
|
||||
export interface ImageOptions {
|
||||
inline: boolean,
|
||||
allowBase64: boolean,
|
||||
HTMLAttributes: Record<string, any>,
|
||||
}
|
||||
|
||||
@@ -28,6 +29,7 @@ export const Image = Node.create<ImageOptions>({
|
||||
addOptions() {
|
||||
return {
|
||||
inline: false,
|
||||
allowBase64: false,
|
||||
HTMLAttributes: {},
|
||||
}
|
||||
},
|
||||
@@ -59,7 +61,9 @@ export const Image = Node.create<ImageOptions>({
|
||||
parseHTML() {
|
||||
return [
|
||||
{
|
||||
tag: 'img[src]:not([src^="data:"])',
|
||||
tag: this.options.allowBase64
|
||||
? 'img[src]'
|
||||
: 'img[src]:not([src^="data:"])',
|
||||
},
|
||||
]
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user