condense rich text functionality to static toolbar

This commit is contained in:
Shawn Erquhart
2017-03-16 20:45:46 -04:00
parent 96453df346
commit b2fd96c12e
11 changed files with 211 additions and 321 deletions

View File

@ -39,13 +39,14 @@ if (process.env.NODE_ENV !== 'production' && module.hot) {
const buildtInPlugins = [{
label: 'Image',
id: 'image',
icon: 'picture',
fromBlock: match => match && {
image: match[2],
alt: match[1],
},
toBlock: data => `![${ data.alt }](${ data.image })`,
toPreview: data => <img src={data.image} alt={data.alt} />,
pattern: /^!\[([^\]]+)\]\(([^\)]+)\)$/,
pattern: /^!\[([^\]]+)]\(([^)]+)\)$/,
fields: [{
label: 'Image',
name: 'image',