Helpers/html

applyStyles

applyStyles(html): string

If the HTML has CSS rules with selectors,
it applies them to the selectors in the HTML itself
and then removes the selector styles, leaving only the inline ones.

Parameters

Name Type
html string

Returns

string

Defined in

src/core/helpers/html/apply-styles.ts#39


cleanFromWord

cleanFromWord(html): string

The method automatically cleans up content from Microsoft Word and other HTML sources to ensure clean, compliant
content that matches the look and feel of the site.

Parameters

Name Type
html string

Returns

string

Defined in

src/core/helpers/html/clean-from-word.ts#20


htmlspecialchars

htmlspecialchars(html): string

Convert special characters to HTML entities

Parameters

Name Type
html string

Returns

string

Defined in

src/core/helpers/html/htmlspecialchars.ts#16


nl2br

nl2br(html): string

Inserts HTML line breaks before all newlines in a string

Parameters

Name Type
html string

Returns

string

Defined in

src/core/helpers/html/nl2br.ts#14


safeHTML

safeHTML(box, options): void

Removes dangerous constructs from HTML

Parameters

Name Type
box HTMLElement | DocumentFragment
options safeOptions

Returns

void

Defined in

src/core/helpers/html/safe-html.ts#22


sanitizeHTMLElement

sanitizeHTMLElement(elm, «destructured»?): boolean

Parameters

Name Type
elm Element | DocumentFragment
«destructured» safeOptions

Returns

boolean

Defined in

src/core/helpers/html/safe-html.ts#43


stripTags

stripTags(html, doc?, exclude?): string

Extract plain text from HTML text

Parameters

Name Type Default value
html string | Node undefined
doc Document document
exclude Nullable<Set<HTMLTagNames>> null

Returns

string

Defined in

jodit/src/core/helpers/html/strip-tags.ts:36