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.
-
overwrite_basic_styles boolean
If set to true, only custom_styles will be visible in the Styles button.
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 booleanIf set to
true
, the style will be treated as a container style. This only works fordiv
elements.