Skip to main content

InterweaveProps

Hierarchy

Indexable

[prop: string]: any

Support all the props used by matchers.

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.

optionaldisableFilters

disableFilters?: boolean

Disable all filters from running.

optionaldisableLineBreaks

disableLineBreaks?: boolean

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

optionaldisableMatchers

disableMatchers?: boolean

Disable all matches from running.

optionalemptyContent

emptyContent?: ReactNode

Content to render when the content prop is empty.

optionalescapeHtml

escapeHtml?: boolean

Escape all HTML before parsing.

optionalfilters

filters?: FilterInterface[]

List of filters to apply to the content.

optionalmatchers

matchers?: MatcherInterface<any>[]

List of matchers to apply to the content.

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.

optionalonAfterParse

onAfterParse?: null | AfterParseCallback<InterweaveProps>

Callback fired after parsing ends. Must return an array of React nodes.

optionalonBeforeParse

onBeforeParse?: null | BeforeParseCallback<InterweaveProps>

Callback fired beore parsing begins. Must return a string.

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.