Skip to content

$convertPreElement

reference
1 min readUpdated

Kind: Function

Source: atloria-monorepo/packages/editor/src/plugins/codeblock/CodeBlockNode.tsx

Converts a

 HTML element into a CodeBlockNode.
Extracts the code content, language, and meta information from the element's attributes.
The language is determined from the class attribute (e.g., class="language-javascript") or
the data-language attribute if available.

Signature

ts
function $convertPreElement(element: Element): DOMConversionOutput

Parameters

NameType
elementElement

Returns: DOMConversionOutput

Was this page helpful?

Download as PDF