markdown-0.1.1.2: Convert Markdown to HTML, with XSS protection

Safe HaskellNone

Text.Markdown

Contents

Synopsis

Functions

markdown :: MarkdownSettings -> Text -> HtmlSource

Convert the given textual markdown content to HTML.

>>> :set -XOverloadedStrings
>>> import Text.Blaze.Html.Renderer.Text
>>> renderHtml $ markdown def "# Hello World!"
"<h1>Hello World!</h1>"
>>> renderHtml $ markdown def { msXssProtect = False } "<script>alert('evil')</script>"
"<script>alert('evil')</script>"

Settings

data MarkdownSettings Source

A settings type providing various configuration options.

See http://www.yesodweb.com/book/settings-types for more information on settings types. In general, you can use def.

msXssProtect :: MarkdownSettings -> BoolSource

Whether to automatically apply XSS protection to embedded HTML. Default: True.

Newtype

newtype Markdown Source

A newtype wrapper providing a ToHtml instance.

Constructors

Markdown Text 

Convenience re-exports

def :: Default a => a

The default value for this type.