Skip to main content

ParserProps

Hierarchy

Index

Properties

optionalallowAttributes

allowAttributes?: boolean

Disable filtering and allow all non-banned HTML attributes.

optionalallowElements

allowElements?: boolean

Disable filtering and allow all non-banned/blocked HTML elements to be rendered.

optionalallowList

allowList?: string[]

List of HTML tag names to allow and render. Defaults to the ALLOWED_TAG_LIST constant.

optionalblockList

blockList?: string[]

List of HTML tag names to disallow and not render. Overrides allow list.

optionalcontainerTagName

containerTagName?: string

The container element to parse content in. Applies browser semantic rules and overrides tagName.

optionaldisableLineBreaks

disableLineBreaks?: boolean

Disable the conversion of new lines to <br /> elements.

optionalescapeHtml

escapeHtml?: boolean

Escape all HTML before parsing.

optionalnoHtml

noHtml?: boolean

Strip all HTML while rendering.

optionalnoHtmlExceptMatchers

noHtmlExceptMatchers?: boolean

Strip all HTML, except HTML generated by matchers, while rendering.

optionaltransform

transform?: null | TransformCallback

Transformer ran on each HTML element. Return a new element, null to remove current element, or undefined to do nothing.

optionaltransformOnlyAllowList

transformOnlyAllowList?: boolean

Disable transformer for non-allowList tags.