diff --git a/src/components/MarkdownPlugins/image.js b/src/components/MarkdownPlugins/image.js index 3611cc4f3aa9..2504b09d0856 100644 --- a/src/components/MarkdownPlugins/image.js +++ b/src/components/MarkdownPlugins/image.js @@ -7,9 +7,9 @@ const image = { image: match[2], alt: match[1], }, - toBlock: data => `![${ data.alt }](${ data.image || '' })`, - toPreview: (data, getAsset) => {data.alt, - pattern: /^!\[([\S\s]*)\]\(([\S\s]*)\)$/, + toBlock: data => `![${ data.alt || '' }](${ data.image || '' })`, + toPreview: (data, getAsset) => {data.alt, + pattern: /^!\[([\S\s]*)\]\((.*)\)$/, fields: [{ label: 'Image', name: 'image',