Skip to main content

html

ai-research-agent / editor/rendering/html

Functions

cleanText()

function cleanText(delta): void

Parameters

ParameterType

delta

default

Returns

void


deltaFromDom()

function deltaFromDom(editor, options): default

Parameters

ParameterTypeDefault value

editor

Editor

undefined

options

FromDomOptions

defaultOptions

Returns

default


deltaFromHTML()

function deltaFromHTML(
editor,
html,
options?): default

Parameters

ParameterType

editor

Editor

html

string

options?

DeltaFromHTMLOptions

Returns

default


docFromDom()

function docFromDom(editor, root): default

Parameters

ParameterType

editor

Editor

root

HTMLElement

Returns

default


docFromHTML()

function docFromHTML(
editor,
html,
selection?): default

Parameters

ParameterType

editor

Editor

html

string

selection?

null | EditorRange

Returns

default


docToHTML()

function docToHTML(editor, doc): string

Parameters

ParameterType

editor

Editor

doc

default

Returns

string


fromNode()

function fromNode(editor, dom): undefined | default | default[]

Parameters

ParameterType

editor

Editor

dom

HTMLElement

Returns

undefined | default | default[]


inlineToHTML()

function inlineToHTML(editor, delta): string

Parameters

ParameterType

editor

Editor

delta

default

Returns

string


isBRPlaceholder()

function isBRPlaceholder(editor, node): boolean

Parameters

ParameterType

editor

Editor

node

Node

Returns

boolean

Interfaces

DeltaFromHTMLOptions

Properties

collapseWhitespace?
optional collapseWhitespace: boolean;
possiblePartial?
optional possiblePartial: boolean;

FromDomOptions

Properties

collapseWhitespace?
optional collapseWhitespace: boolean;
endNode?
optional endNode: Node;
includeIds?
optional includeIds: boolean;
offset?
optional offset: number;
possiblePartial?
optional possiblePartial: boolean;
root?
optional root: HTMLElement;
startNode?
optional startNode: Node;

Variables

BLOCK_ELEMENTS

const BLOCK_ELEMENTS: "address, article, aside, blockquote, editor, dd, div, dl, dt, fieldset, figcaption, figure, footer, form,  header, hr, li, main, nav, noscript, ol, output, p, pre, section, table, tfoot, ul, video" = 'address, article, aside, blockquote, editor, dd, div, dl, dt, fieldset, figcaption, figure, footer, form,  header, hr, li, main, nav, noscript, ol, output, p, pre, section, table, tfoot, ul, video';