Adding Table Support

This commit is contained in:
Chrissi2812
2018-12-06 18:07:08 +01:00
parent 19202f25f0
commit c830768b3b
18 changed files with 473 additions and 0 deletions

View File

@@ -0,0 +1,20 @@
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)
}
},
},
},
})