This is a lower-level API. Lower-level APIs are not recommended for most projects, and may not be available on all plans. See our page on recommended deployment patterns for more information.
Initialization Option Question Editor API

rich_text_editor

This is the initialization option which determines the rich text editor that will be used by the Question Editor API. All customizable attributes are defined in this object.

Values

Request object key rich_text_editor

Type object

This object has the following properties which can be configured.

  • customButtons array

    If defined, the rich text editor will display a custom button in it's toolbar.

  • custom_styles array

    An array of extra styles to include in the styles dropdown.

  • font_settings object

    Used to set custom font colors.

  • font_sizes object

    Used to set font sizes.

  • overwrite_basic_styles boolean

    If set to true, only custom_styles will be visible in the Styles button.

  • toolbar_settings object

    Can be used to customize the rich text editor's toolbar.

Type definitions

CustomButton object

  • attributes array

    An array of string containing the selectors of the rich text editors with which the custom buttons are to be associated. If this is undefined the buttons will be associated with all rich text editor instances. For array type fields like options, you can either define a selector for a specific entry, e.g. options[0], or you can specify a selector targeting the whole array, e.g. options[*].

  • func RichTextEditorCustomButtonCallback
  • icon string

    A link to the button icon (Recommended dimensions: 25px by 25px).

  • label string

    The button label.

  • name string

    A unique identifier for the button.

RichTextEditorCustomButtonCallback function

The callback function which is executed when the custom button is clicked.

  • attribute string
  • callback function

    Call this function to add the custom content to the text editor.

    • customContent string

      The custom HTML content to be added to the text editor.

CustomStyle object

  • element string

    The element to wrap content with inside the editor when the style is applied (eg. "em", "strong", "blockquote"). Defaults to "span".

  • element_class string

    An additional class to be placed on the element surrounding the styled text for custom CSS. It is also the class to be placed on the label in the dropdown, allowing the said label to be styled by custom CSS.

  • label string

    The name of the style as shown in the dropdown.

  • is_container_style boolean
    If set to true, the style will be treated as a container style. This only works for div elements.
Was this article helpful?