fix: Only trigger image input rule at the start or with a preceding space

This commit is contained in:
Ricardo Amaral
2022-05-26 16:44:21 +01:00
committed by Dominik
parent 47f2444128
commit 5fef431d09

View File

@@ -21,7 +21,7 @@ declare module '@tiptap/core' {
} }
} }
export const inputRegex = /(!\[(.+|:?)]\((\S+)(?:(?:\s+)["'](\S+)["'])?\))$/ export const inputRegex = /(?:^|\s)(!\[(.+|:?)]\((\S+)(?:(?:\s+)["'](\S+)["'])?\))$/
export const Image = Node.create<ImageOptions>({ export const Image = Node.create<ImageOptions>({
name: 'image', name: 'image',