(name, tag, content, extra = {})
| 148 | |
| 149 | function buildExtensions ({ Node, Mark, Extension, Plugin, Decoration, DecorationSet }) { |
| 150 | const blockNode = (name, tag, content, extra = {}) => Node.create({ |
| 151 | name, |
| 152 | group: 'block', |
| 153 | content: content || 'block+', |
| 154 | ...extra, |
| 155 | addAttributes () { |
| 156 | return { htmlAttrs: { default: {} } } |
| 157 | }, |
| 158 | parseHTML () { |
| 159 | return [{ tag, getAttrs: collectDomAttrs }] |
| 160 | }, |
| 161 | renderHTML ({ node }) { |
| 162 | return [tag, node.attrs.htmlAttrs, 0] |
| 163 | } |
| 164 | }) |
| 165 | |
| 166 | const attrsMark = (name, tag) => Mark.create({ |
| 167 | name, |
no test coverage detected