mirror of
https://github.com/ueberdosis/tiptap.git
synced 2024-11-28 07:40:13 +08:00
Image input rule leaves erroneous text behind due to my previous change to add group matching in #1574. This change adds a `( ... )` regex group around the image input rule to have it work with the new code.
This commit is contained in:
parent
d8ef1593af
commit
503a3f2cf5
@ -20,7 +20,7 @@ declare module '@tiptap/core' {
|
||||
}
|
||||
}
|
||||
|
||||
export const inputRegex = /!\[(.+|:?)]\((\S+)(?:(?:\s+)["'](\S+)["'])?\)/
|
||||
export const inputRegex = /(!\[(.+|:?)]\((\S+)(?:(?:\s+)["'](\S+)["'])?\))/
|
||||
|
||||
export const Image = Node.create<ImageOptions>({
|
||||
name: 'image',
|
||||
@ -83,7 +83,7 @@ export const Image = Node.create<ImageOptions>({
|
||||
find: inputRegex,
|
||||
type: this.type,
|
||||
getAttributes: match => {
|
||||
const [, alt, src, title] = match
|
||||
const [,, alt, src, title] = match
|
||||
|
||||
return { src, alt, title }
|
||||
},
|
||||
|
Loading…
Reference in New Issue
Block a user