fix image form not displaying when added as first item in markdown widget

This commit is contained in:
Damien Duhamel 2017-12-21 20:35:30 +01:00 committed by Shawn Erquhart
parent a1b947a23e
commit 8849953b50

View File

@ -8,8 +8,8 @@ const image = {
alt: match[1],
},
toBlock: data => `![${ data.alt || '' }](${ data.image || '' })`,
toPreview: (data, getAsset) => <img src={getAsset(data.image || '')} alt={data.alt || ''} />,
pattern: /^!\[([^\]]+)]\(([^)]+)\)$/,
toPreview: (data, getAsset) => <img src={getAsset(data.image) || ''} alt={data.alt || ''} />,
pattern: /^!\[(.*)\]\((.*)\)$/,
fields: [{
label: 'Image',
name: 'image',