CharacterLimitReached
allows you to get notified if too much text is entered.
FromBrowserClipboard
and ToBrowserClipboard
can be used to handle copy/pasting text from the RTE to other apps and vice versa. See the example.
InternalMsg
is not part of the API.
A highlighter is a Content -> Content
function that you can inject into the model using setHighlighter
.
The function should modify the highlightClasses
, highlightIndent
, or highlightStyling
fields of the elements.
Each string x
in highlightClasses
turns into Html.(Styled.)Attribute.class x
.
Each (x,y)
in highlightStyling
turns into Html.(Styled.)Attribute.style x y
.
Attributes of LineBreak
s apply to the paragraph (the previous non-linebreak elements) as a whole.
Array Element
{ char : Char
, fontStyle : FontStyle
, highlightClasses : List String
, highlightStyling : List ( String
, String )
, link : Maybe String
}
{ attributes : List ( String
, String )
, classes : List String
, children : List Child
, highlightClasses : List String
, highlightStyling : List ( String
, String )
, nodeType : Maybe String
, styling : List ( String
, String )
, text : Maybe String
}
You can embed any html node using this type. The RTE will only be able to delete or copy/paste these elements.
emptyEmbeddedHtml : EmbeddedHtmlRecord
An empty div.
{ classes : List String
, highlightClasses : List String
, highlightIndent : Basics.Int
, highlightStyling : List ( String
, String )
, id : String
, indent : Basics.Int
, nodeType : Maybe String
, styling : List ( String
, String )
, textAlign : TextAlignType
}
{ classes : List String
, fontFamily : List String
, fontSize : Maybe Basics.Float
, styling : List ( String
, String )
}