Skip to main content

Class: CodeHighlightNode

@lexical/code.CodeHighlightNode

Hierarchy

Constructors

constructor

new CodeHighlightNode(text, highlightType?, key?)

Parameters

NameType
textstring
highlightType?null | string
key?string

Overrides

TextNode.constructor

Defined in

lexical-code/src/CodeHighlightNode.ts:106

Methods

createDOM

createDOM(config): HTMLElement

Parameters

NameType
configEditorConfig

Returns

HTMLElement

Overrides

TextNode.createDOM

Defined in

lexical-code/src/CodeHighlightNode.ts:132


createParentElementNode

createParentElementNode(): ElementNode

Returns

ElementNode

Overrides

TextNode.createParentElementNode

Defined in

lexical-code/src/CodeHighlightNode.ts:185


exportJSON

exportJSON(): SerializedCodeHighlightNode

Returns

SerializedCodeHighlightNode

Overrides

TextNode.exportJSON

Defined in

lexical-code/src/CodeHighlightNode.ts:167


getHighlightType

getHighlightType(): undefined | null | string

Returns

undefined | null | string

Defined in

lexical-code/src/CodeHighlightNode.ts:127


isParentRequired

isParentRequired(): true

Returns

true

Overrides

TextNode.isParentRequired

Defined in

lexical-code/src/CodeHighlightNode.ts:181


setFormat

setFormat(format): CodeHighlightNode

Parameters

NameType
formatnumber

Returns

CodeHighlightNode

Overrides

TextNode.setFormat

Defined in

lexical-code/src/CodeHighlightNode.ts:177


updateDOM

updateDOM(prevNode, dom, config): boolean

Parameters

NameType
prevNodeCodeHighlightNode
domHTMLElement
configEditorConfig

Returns

boolean

Overrides

TextNode.updateDOM

Defined in

lexical-code/src/CodeHighlightNode.ts:142


clone

Static clone(node): CodeHighlightNode

Parameters

NameType
nodeCodeHighlightNode

Returns

CodeHighlightNode

Overrides

TextNode.clone

Defined in

lexical-code/src/CodeHighlightNode.ts:119


getType

Static getType(): string

Returns

string

Overrides

TextNode.getType

Defined in

lexical-code/src/CodeHighlightNode.ts:115