RTElement

An object used to define a rich text element.

In rich text documents, elements such as paragraphs, images, links, etc. are defined using RTElement objects.

There are two 'levels' of rich text elements: block and inline. 'block' level elements are rendered as blocks (e.g. paragraphs). 'inline' level elements, are rendered inline with text (e.g. links).

See the RTBlockElement interface and RTInlineElement interface for details on each level of element.

Every rich text element has a 'type' property (e.g. 'paragraph' or 'link'). To create elements of a given type, the element type must first be registered using the RTElements.register method, which takes a rich text element type configuration object.

See the RTBlockElementConfig interface and RTInlineElementConfig interface for details on the configuration options for each level of element.

Void elements are elements which either do not contain text (e.g. an image element), or elements in which the text is not edited as part of the editor's text flow (e.g. edited in a popup).

The children property is an array consiting of RTNodes and RTInlineElements (known as a RTFragment) which constitutes the actual text content of the element. Block level elements are not permitted in children.

All non-void elements must have a children property. Void elements should not have a children property.