The edited content of the RTE.
Don't forget to hook subscriptions and update into your app's own subscriptions and update function. Otherwise the RTE won't do anything.
Note: When the RTE is active (the textarea object is part of your view), it keeps taking away the focus from every other element. Use freeze to stop this.
Display, in an uneditable div, the content generated by the RTE.
Same with some parameters.
Same but using a json generated with encodeContentString.
Same with some parameters.
Same as the previous but with Html.Styled.
Control whether pasting something that begins with with http(s):// becomes a clickable link. Default is False.
Prevent typing more than a certain number of characters. There is no default limit, but the RTE becomes increasingly slow for longer texts (>10-12K characters).
Defaults to px.
See MiniRte.Types on highlighters.
Defaults to (50,"px"). Matters when you use increaseIndent or decreaseIndent.
Controls how selected text looks. Defaults to [("background","hsl(217,71%,53%)"), ("color","hsl(0,0%,100%)")].
When you paste an image link x, it becomes an img element with src=x.
Something qualifies as an image link iff it starts with data:image/ or it ends with .jpeg, .jpg, .gif, .png, .apng, .svg, .bmp, or .ico.
You can build a rich text editor toolbar from these (see the example in the repo).
Add content at current cursor position.
Embed a custom html node within text.
An img node with the specified src.
Copy current selection. Results in a ToBrowserClipboard Msg which must be captured in update. See the example in the repo.
Clears the editor and loads new content.
Same with plain text.
Controls the font size within the selected text / at the current cursor position.
Turns the current paragraph into an h1 element.
The font-family (set with toggleFontFamily) at the cursor position.
The font-size (set with setFontSize) at the cursor position.
The plain text content of the RTE.
Convert serialized content string into edited content.
Convert gzipped serialized content into edited content.
Serialize the edited content as string.
Serialize the edited content as a gzip file.
Ctrl-0: en dash (–)Ctrl-1: em dash (—)Ctrl-Z: undo
The rich text editor. --(Under the hood), it is a record type that tracks cursor position, selection, formatting etc.