Skip to main content

MarkupProps

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.

optionalattributes

attributes?: Attributes

HTML attributes to pass to the wrapping element.

optionalblockList

blockList?: string[]

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

optionalclassName

className?: string

CSS class name to pass to the wrapping element.

optionalcontainerTagName

containerTagName?: string

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

optionalcontent

content?: null | string

Content that may contain HTML to safely render.

optionaldisableLineBreaks

disableLineBreaks?: boolean

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

optionalemptyContent

emptyContent?: ReactNode

Content to render when the content prop is empty.

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.

optionalnoWrap

noWrap?: boolean

Don’t wrap the content in a new element specified by tagName.

optionaltagName

tagName?: string

HTML element to wrap the content. Also accepts ‘fragment’ (superseded by noWrap).

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.