dkodaj/rte/1.1.5

NOTE: the latest version is 10.0.1

MiniRte.Types

When writing a highlighter, modify the highlightClasses or highlightStyling fields of the elements.

Each string x in highlightClasses turns into Html.Attribute.class x.

Each (x,y) in highlightStyling turns into Html.Attribute.style x y.

Attributes of LineBreaks apply to the preceding paragraph as a whole.

type alias Content =
List Element
type Element
= Break LineBreak
| Char Character
| Embedded EmbeddedHtml
type alias Character =
{ char : Char
, fontStyle : FontStyle
, highlightClasses : List String
, highlightStyling : StyleTags
, id : Int
, link : Maybe String
}
type alias EmbeddedHtml =
{ attributes : List ( String, String )
, classes : List String
, children : List Child
, highlightClasses : List String
, highlightStyling : StyleTags
, id : Int
, nodeType : Maybe String
, styling : StyleTags
, text : Maybe String
}
type alias LineBreak =
{ classes : List String
, highlightClasses : List String
, highlightIndent : Int
, highlightStyling : StyleTags
, id : Int
, indent : Int
, nodeType : Maybe String
, styling : StyleTags
}
type Child
= Child EmbeddedHtml
type alias FontStyle =
{ classes : List String
, fontFamily : List String
, fontSize : Maybe Float
, styling : StyleTags
}
type alias StyleTags =
List ( String, String )
= Center
| Left
| Right