Configure markdown to fit your needs.
Choose what to do with raw html elements.
ParseUnsafe: Will parse any valid html tag and attribute. This includes malicious code like <script>alert("XSS ALERT!!");</script>.Sanitize SanitizeOptions: Will parse only specific html elements and attributes.DontParse: Do not parse any html tag. It will include the raw text in the output.Choose what html elements and attributes are allowed to parse.
allowedHtmlElements: List of allowed html elements.allowedHtmlAttributes: List of allowed attributes.The Options used in Markdown.toHtml.
{ softAsHardLineBreak = False
, rawHtml = Sanitize defaultSanitizeOptions
}The SanitizeOptions used by defaultOptions.
{ allowedHtmlElements =
[ "address", "article", "aside", "b", "blockquote"
, "body","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", "link", "main", "menu", "menuitem"
, "nav", "ol", "optgroup", "option", "p", "pre", "section"
, "strike", "summary", "small", "table", "tbody", "td"
, "tfoot", "th", "thead", "title", "tr", "ul" ]
, allowedHtmlAttributes =
[ "name", "class" ]
}A record to be used with customHtml of how each element
is rendered to html.
The elements used in toHtml and withOptions.
Code block element model. If you want to use a highlight package, you have access to the code here.
List element model. The Int in Ordered Int is the
first number used to start an ordered list.
Image element model.
Link element model.
Some parser options so you can tweak things for your particular case.
softAsHardLineBreak: If set toTrue, will render\nas<br />.rawHtml: This determine what to do with raw html elements.