MCPcopy
hub / github.com/marktext/marktext / createDomNode

Method createDomNode

packages/muya/src/block/base/treeNode.ts:98–114  ·  view source on GitHub ↗

* create domNode

()

Source from the content-addressed store, hash-verified

96 * create domNode
97 */
98 createDomNode() {
99 const { tagName, classList, attributes, datasets } = this;
100
101 const domNode = createDomNode(tagName, {
102 classList,
103 attributes,
104 datasets,
105 });
106
107 // Concrete subclasses are always Parent | Content, but the static
108 // signature here is TreeNode (Format extends Content via a separate
109 // file). Mark the DOM property with the runtime subtype.
110 // eslint-disable-next-line no-restricted-syntax
111 domNode[BLOCK_DOM_PROPERTY] = this as unknown as Parent | Content;
112
113 this.domNode = domNode;
114 }
115
116 // Get previous content block in block tree.
117 previousContentInContext(): Nullable<Content> {

Callers

nothing calls this directly

Calls 1

createDomNodeFunction · 0.90

Tested by

no test coverage detected