MCPcopy Create free account
hub / github.com/docusealco/docuseal / blockNode

Function blockNode

app/javascript/elements/html_editor.js:150–164  ·  view source on GitHub ↗
(name, tag, content, extra = {})

Source from the content-addressed store, hash-verified

148
149function 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,

Callers 1

buildExtensionsFunction · 0.85

Calls 1

createMethod · 0.45

Tested by

no test coverage detected