pablohirafuji / elm-markdown / Markdown.Config

Configure markdown to fit your needs.

Options


type alias Options =
{ softAsHardLineBreak : Basics.Bool
, rawHtml : HtmlOption 
}

Some parser options so you can tweak things for your particular case.


type HtmlOption
    = ParseUnsafe
    | Sanitize SanitizeOptions
    | DontParse

Choose what to do with raw html tags.


type alias SanitizeOptions =
{ allowedHtmlElements : List String
, allowedHtmlAttributes : List String 
}

Choose what html elements and attributes are allowed to parse.

defaultOptions : Options

The Options used in Markdown.toHtml.

{ softAsHardLineBreak = False
, rawHtml = Sanitize defaultSanitizeOptions
}

defaultSanitizeOptions : SanitizeOptions

The SanitizeOptions used by defaultOptions.

{ allowedHtmlElements =
    [ "address", "article", "aside", "b", "blockquote", "br"
    , "caption", "center", "cite", "code", "col", "colgroup"
    , "dd", "details", "div", "dl", "dt", "figcaption", "figure"
    , "footer", "h1", "h2", "h3", "h4", "h5", "h6", "hr", "i"
    , "legend", "li", "menu", "menuitem", "nav", "ol", "optgroup"
    , "option", "p", "pre", "section", "strike", "summary"
    , "small", "table", "tbody", "td", "tfoot", "th", "thead"
    , "tr", "ul" ]
, allowedHtmlAttributes =
    [ "name", "class" ]
}