UNPKG

@atlaskit/adf-schema

Version:

Shared package that contains the ADF-schema (json) and ProseMirror node/mark specs

33 lines 558 B
export const image = { group: 'inline', inline: true, attrs: { src: { default: '' }, alt: { default: '' }, title: { default: null } }, draggable: true, parseDOM: [{ tag: 'img[src^="data:image/"]', ignore: true }, { tag: 'img[src]', getAttrs(domNode) { const dom = domNode; return { src: dom.getAttribute('src'), alt: dom.getAttribute('alt'), title: dom.getAttribute('title') }; } }], toDOM(node) { return ['img', node.attrs]; } };