Class: GenericHTMLNode
A Lexical node that represents a generic HTML element. Use $createGenericHTMLNode to construct one. The generic HTML node is used as a "fallback" for HTML elements that are not explicitly supported by the editor.
Extends
ElementNode
Constructors
new GenericHTMLNode()
new GenericHTMLNode(
tag
,type
,attributes
,key
?):GenericHTMLNode
Constructs a new GenericHTMLNode with the specified MDAST HTML node as the object to edit.
Parameters
Parameter | Type |
---|---|
tag | "object" | "link" | "small" | "sub" | "sup" | "a" | "abbr" | "address" | "area" | "article" | "aside" | "audio" | "b" | "base" | "bdi" | "bdo" | "blockquote" | "body" | "br" | "button" | "canvas" | "caption" | "cite" | "code" | "col" | "colgroup" | "data" | "datalist" | "dd" | "del" | "details" | "dfn" | "dialog" | "div" | "dl" | "dt" | "em" | "embed" | "fieldset" | "figcaption" | "figure" | "footer" | "form" | "h1" | "h2" | "h3" | "h4" | "h5" | "h6" | "head" | "header" | "hgroup" | "hr" | "html" | "i" | "iframe" | "input" | "ins" | "kbd" | "label" | "legend" | "li" | "main" | "map" | "mark" | "meta" | "meter" | "nav" | "noscript" | "ol" | "optgroup" | "option" | "output" | "p" | "param" | "picture" | "pre" | "progress" | "q" | "rp" | "rt" | "ruby" | "s" | "samp" | "script" | "section" | "select" | "source" | "span" | "strong" | "style" | "summary" | "table" | "template" | "tbody" | "td" | "textarea" | "tfoot" | "th" | "thead" | "time" | "title" | "tr" | "track" | "u" | "ul" | "var" | "video" | "wbr" |
type | "mdxJsxFlowElement" | "mdxJsxTextElement" |
attributes | MdxJsxAttribute [] |
key ? | string |
Returns
Overrides
ElementNode.constructor
Methods
createDOM()
createDOM():
HTMLElement
Returns
HTMLElement
Overrides
ElementNode.createDOM
exportDOM()
exportDOM(
editor
):DOMExportOutput
Parameters
Parameter | Type |
---|---|
editor | LexicalEditor |
Returns
DOMExportOutput
Overrides
ElementNode.exportDOM
exportJSON()
exportJSON():
SerializedGenericHTMLNode
Returns
Overrides
ElementNode.exportJSON
extractWithChild()
extractWithChild():
boolean
Returns
boolean
Overrides
ElementNode.extractWithChild
getAttributes()
getAttributes():
MdxJsxAttribute
[]
Returns
MdxJsxAttribute
[]
getNodeType()
getNodeType():
"mdxJsxFlowElement"
|"mdxJsxTextElement"
Returns
"mdxJsxFlowElement"
| "mdxJsxTextElement"
getStyle()
getStyle():
string
Returns
string
Overrides
ElementNode.getStyle
getTag()
getTag():
"object"
|"link"
|"small"
|"sub"
|"sup"
|"a"
|"abbr"
|"address"
|"area"
|"article"
|"aside"
|"audio"
|"b"
|"base"
|"bdi"
|"bdo"
|"blockquote"
|"body"
|"br"
|"button"
|"canvas"
|"caption"
|"cite"
|"code"
|"col"
|"colgroup"
|"data"
|"datalist"
|"dd"
|"del"
|"details"
|"dfn"
|"dialog"
|"div"
|"dl"
|"dt"
|"em"
|"embed"
|"fieldset"
|"figcaption"
|"figure"
|"footer"
|"form"
|"h1"
|"h2"
|"h3"
|"h4"
|"h5"
|"h6"
|"head"
|"header"
|"hgroup"
|"hr"
|"html"
|"i"
|"iframe"
|"input"
|"ins"
|"kbd"
|"label"
|"legend"
|"li"
|"main"
|"map"
|"mark"
|"meta"
|"meter"
|"nav"
|"noscript"
|"ol"
|"optgroup"
|"option"
|"output"
|"p"
|"param"
|"picture"
|"pre"
|"progress"
|"q"
|"rp"
|"rt"
|"ruby"
|"s"
|"samp"
|"script"
|"section"
|"select"
|"source"
|"span"
|"strong"
|"style"
|"summary"
|"table"
|"template"
|"tbody"
|"td"
|"textarea"
|"tfoot"
|"th"
|"thead"
|"time"
|"title"
|"tr"
|"track"
|"u"
|"ul"
|"var"
|"video"
|"wbr"
Returns
"object"
| "link"
| "small"
| "sub"
| "sup"
| "a"
| "abbr"
| "address"
| "area"
| "article"
| "aside"
| "audio"
| "b"
| "base"
| "bdi"
| "bdo"
| "blockquote"
| "body"
| "br"
| "button"
| "canvas"
| "caption"
| "cite"
| "code"
| "col"
| "colgroup"
| "data"
| "datalist"
| "dd"
| "del"
| "details"
| "dfn"
| "dialog"
| "div"
| "dl"
| "dt"
| "em"
| "embed"
| "fieldset"
| "figcaption"
| "figure"
| "footer"
| "form"
| "h1"
| "h2"
| "h3"
| "h4"
| "h5"
| "h6"
| "head"
| "header"
| "hgroup"
| "hr"
| "html"
| "i"
| "iframe"
| "input"
| "ins"
| "kbd"
| "label"
| "legend"
| "li"
| "main"
| "map"
| "mark"
| "meta"
| "meter"
| "nav"
| "noscript"
| "ol"
| "optgroup"
| "option"
| "output"
| "p"
| "param"
| "picture"
| "pre"
| "progress"
| "q"
| "rp"
| "rt"
| "ruby"
| "s"
| "samp"
| "script"
| "section"
| "select"
| "source"
| "span"
| "strong"
| "style"
| "summary"
| "table"
| "template"
| "tbody"
| "td"
| "textarea"
| "tfoot"
| "th"
| "thead"
| "time"
| "title"
| "tr"
| "track"
| "u"
| "ul"
| "var"
| "video"
| "wbr"
isInline()
isInline():
boolean
Returns
boolean
Overrides
ElementNode.isInline
updateAttributes()
updateAttributes(
attributes
):void
Parameters
Parameter | Type |
---|---|
attributes | MdxJsxAttribute [] |
Returns
void
updateDOM()
updateDOM():
boolean
Returns
boolean
Overrides
ElementNode.updateDOM
importDOM()
static
importDOM():null
|DOMConversionMap
Returns
null
| DOMConversionMap
Overrides
ElementNode.importDOM
importJSON()
static
importJSON(serializedNode
):GenericHTMLNode
Parameters
Parameter | Type |
---|---|
serializedNode | SerializedGenericHTMLNode |
Returns
Overrides
ElementNode.importJSON