Home > @uniformdev/richtext

richtext package

Functions

<table><thead><tr><th>

Function

</th><th>

Description

</th></tr></thead> <tbody><tr><td>

getLabelForElement(type)

</td><td>

</td></tr> <tr><td>

getLabelForFormat(type)

</td><td>

</td></tr> <tr><td>

getRichTextTagsFromTextFormat(format)

</td><td>

Convert format bitflag for holding text formats into relevant tags

</td></tr> <tr><td>

hasChildren(node)

</td><td>

</td></tr> <tr><td>

isArrayWithLength(arr)

</td><td>

</td></tr> <tr><td>

isPureDirection(direction)

</td><td>

</td></tr> <tr><td>

isPureTextAlign(format)

</td><td>

</td></tr> <tr><td>

isRichTextNode(node)

</td><td>

</td></tr> <tr><td>

isRichTextNodeType(node, type)

</td><td>

</td></tr> <tr><td>

isRichTextNodeType(node, type)

</td><td>

</td></tr> <tr><td>

isRichTextNodeType(node, type)

</td><td>

</td></tr> <tr><td>

isRichTextNodeType(node, type)

</td><td>

</td></tr> <tr><td>

isRichTextNodeType(node, type)

</td><td>

</td></tr> <tr><td>

isRichTextNodeType(node, type)

</td><td>

</td></tr> <tr><td>

isRichTextNodeType(node, type)

</td><td>

</td></tr> <tr><td>

isRichTextValue(value)

</td><td>

</td></tr> <tr><td>

isRichTextValueConsideredEmpty(value)

</td><td>

</td></tr> <tr><td>

linkParamValueToHref(link)

</td><td>

</td></tr> <tr><td>

purifyText(text)

</td><td>

</td></tr> <tr><td>

renderChildrenToHtml(children, context)

</td><td>

Render an array of RichTextNodes to a string based on a particular context.

This will often be called from within a NodeRenderer using the renderChildren prop.

</td></tr> <tr><td>

renderChildrenToText(children, context)

</td><td>

Render an array of RichTextNodes to a string based on a particular context.

This will often be called from within a NodeRenderer using the renderChildren prop.

</td></tr> <tr><td>

renderHtmlElement(tag, attributes, children)

</td><td>

</td></tr> <tr><td>

renderToHtml(node, parentContext)

</td><td>

Render a node and its children to HTML

This could be the root node or a nested node

</td></tr> <tr><td>

renderToText(node, parentContext)

</td><td>

Render a node and its children to text

This could be the root node or a nested node

</td></tr> <tr><td>

walkRichTextTree(node, callback, parent)

</td><td>

</td></tr> </tbody></table>

Interfaces

<table><thead><tr><th>

Interface

</th><th>

Description

</th></tr></thead> <tbody><tr><td>

HeadingNode

</td><td>

</td></tr> <tr><td>

LinkNode

</td><td>

</td></tr> <tr><td>

ListItemNode

</td><td>

</td></tr> <tr><td>

ListNode

</td><td>

</td></tr> <tr><td>

NodeStringRendererProps

</td><td>

</td></tr> <tr><td>

ParagraphNode

</td><td>

</td></tr> <tr><td>

RichTextNode

</td><td>

</td></tr> <tr><td>

StringRenderContext

</td><td>

</td></tr> <tr><td>

TextNode

</td><td>

</td></tr> </tbody></table>

Variables

<table><thead><tr><th>

Variable

</th><th>

Description

</th></tr></thead> <tbody><tr><td>

headingHtmlRenderer

</td><td>

</td></tr> <tr><td>

linkHtmlRenderer

</td><td>

</td></tr> <tr><td>

listHtmlRenderer

</td><td>

</td></tr> <tr><td>

listitemHtmlRenderer

</td><td>

</td></tr> <tr><td>

paragraphHtmlRenderer

</td><td>

</td></tr> <tr><td>

resolveDefaultHtmlRenderer

</td><td>

When a custom renderer has not been provided we check to see if there is a renderer for the type within the map above. These are for any node types which include extra logic.

Some node types like quote just map directly to a HTML tag (ie blockquote). For those there is a simple type -> tag Map.

</td></tr> <tr><td>

resolveDefaultTextRenderer

</td><td>

When a custom renderer has not been provided we check to see if there is a renderer for the type within the map above. These are for any node types which include extra logic.

</td></tr> <tr><td>

richTextBuiltInElements

</td><td>

</td></tr> <tr><td>

richTextBuiltInFormats

</td><td>

</td></tr> <tr><td>

rootHtmlRenderer

</td><td>

</td></tr> <tr><td>

textHtmlRenderer

</td><td>

</td></tr> </tbody></table>

Type Aliases

<table><thead><tr><th>

Type Alias

</th><th>

Description

</th></tr></thead> <tbody><tr><td>

NodeStringRenderer

</td><td>

</td></tr> <tr><td>

ParameterRichTextValue

</td><td>

</td></tr> <tr><td>

ResolveStringRenderer

</td><td>

</td></tr> <tr><td>

RichTextNodeWithChildren

</td><td>

</td></tr> </tbody></table>