UNPKG

tiptap-extensions

Version:

Extensions for tiptap

21 lines (19 loc) 479 B
import { tableNodes } from 'prosemirror-tables' export default tableNodes({ tableGroup: 'block', cellContent: 'block+', cellAttributes: { background: { default: null, getFromDOM(dom) { return dom.style.backgroundColor || null }, setDOMAttr(value, attrs) { if (value) { const style = { style: `${(attrs.style || '')}background-color: ${value};` } Object.assign(attrs, style) } }, }, }, })