-- Hoogle documentation, generated by Haddock -- See Hoogle, http://www.haskell.org/hoogle/ -- | Convert Markdown to HTML, with XSS protection -- -- This library leverages existing high-performance libraries -- (attoparsec, blaze-html, text, and conduit), and should integrate well -- with existing codebases. @package markdown @version 0.1.2 module Text.Markdown -- | 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>"
--   
markdown :: MarkdownSettings -> Text -> Html -- | 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. data MarkdownSettings -- | Whether to automatically apply XSS protection to embedded HTML. -- Default: True. msXssProtect :: MarkdownSettings -> Bool -- | HTML snippets which stand on their own. We do not require a blank line -- following these pieces of HTML. -- -- Default: empty set. -- -- Since: 0.1.2 msStandaloneHtml :: MarkdownSettings -> Set Text -- | Handlers for the special "fenced" format. This is most commonly used -- for fenced code, e.g.: -- --
--   ```haskell
--   main = putStrLn "Hello"
--   ```
--   
-- -- This is an extension of Markdown, but a fairly commonly used one. -- -- This setting allows you to create new kinds of fencing. Fencing goes -- into two categories: parsed and raw. Code fencing would be in the raw -- category, where the contents are not treated as Markdown. Parsed will -- treat the contents as Markdown and allow you to perform some kind of -- modifcation to it. -- -- For example, to create a new @@@ fencing which wraps up the -- contents in an article tag, you could use: -- --
--   def { msFencedHandlers = htmlFencedHandler "@@@" (const "<article>") (const "</article")
--                `Map.union` msFencedHandlers def
--       }
--   
-- -- Default: code fencing for ``` and ~~~. -- -- Since: 0.1.2 msFencedHandlers :: MarkdownSettings -> Map Text (Text -> FencedHandler) -- | A newtype wrapper providing a ToHtml instance. newtype Markdown Markdown :: Text -> Markdown -- | See 'msFencedHandlers. -- -- Since 0.1.2 data FencedHandler -- | Wrap up the given raw content. FHRaw :: (Text -> [Block Text]) -> FencedHandler -- | Wrap up the given parsed content. FHParsed :: ([Block Text] -> [Block Text]) -> FencedHandler -- | Helper for creating a FHRaw. -- -- Since 0.1.2 codeFencedHandler :: Text -> Map Text (Text -> FencedHandler) -- | Helper for creating a FHParsed. -- -- Note that the start and end parameters take a Text parameter; -- this is the text following the delimiter. For example, with the -- markdown: -- --
--   @@@ foo
--   
-- -- foo would be passed to start and end. -- -- Since 0.1.2 htmlFencedHandler :: Text -> (Text -> Text) -> (Text -> Text) -> Map Text (Text -> FencedHandler) -- | The default value for this type. def :: Default a => a instance Monoid Markdown instance IsString Markdown instance ToMarkup Markdown