Class: CodeBlockNode
A lexical node that represents a fenced code block. Use "$createCodeBlockNode" to construct one.
Extends
DecoratorNode
<JSX.Element
>
Constructors
new CodeBlockNode()
new CodeBlockNode(
code
,language
,meta
,key
?):CodeBlockNode
Parameters
Parameter | Type |
---|---|
code | string |
language | string |
meta | string |
key ? | string |
Returns
Overrides
DecoratorNode<JSX.Element>.constructor
Methods
createDOM()
createDOM(
_config
):HTMLDivElement
Parameters
Parameter | Type |
---|---|
_config | EditorConfig |
Returns
HTMLDivElement
Overrides
DecoratorNode.createDOM
decorate()
decorate(
editor
):Element
Parameters
Parameter | Type |
---|---|
editor | LexicalEditor |
Returns
Element
Overrides
DecoratorNode.decorate
exportJSON()
exportJSON():
SerializedCodeBlockNode
Returns
Overrides
DecoratorNode.exportJSON
getCode()
getCode():
string
Returns
string
getLanguage()
getLanguage():
string
Returns
string
getMeta()
getMeta():
string
Returns
string
isInline()
isInline():
boolean
Returns
boolean
Overrides
DecoratorNode.isInline
select()
select():
void
Returns
void
setCode()
setCode(
code
):void
Parameters
Parameter | Type |
---|---|
code | string |
Returns
void
setLanguage()
setLanguage(
language
):void
Parameters
Parameter | Type |
---|---|
language | string |
Returns
void
setMeta()
setMeta(
meta
):void
Parameters
Parameter | Type |
---|---|
meta | string |
Returns
void
updateDOM()
updateDOM():
false
Returns
false
Overrides
DecoratorNode.updateDOM
clone()
static
clone(node
):CodeBlockNode
Parameters
Parameter | Type |
---|---|
node | CodeBlockNode |
Returns
Overrides
DecoratorNode.clone
getType()
static
getType():string
Returns
string
Overrides
DecoratorNode.getType
importJSON()
static
importJSON(serializedNode
):CodeBlockNode
Parameters
Parameter | Type |
---|---|
serializedNode | SerializedCodeBlockNode |
Returns
Overrides
DecoratorNode.importJSON
Properties
Property | Type | Default value |
---|---|---|
__code | string | undefined |
__focusEmitter | object | ... |
__focusEmitter.publish | () => void | ... |
__focusEmitter.subscribe | (cb : () => void ) => void | ... |
__language | string | undefined |
__meta | string | undefined |