packages feed

markdown 0.1.13.2 → 0.1.14

raw patch · 4 files changed

+16/−3 lines, 4 filesdep +xml-conduitdep +xml-types

Dependencies added: xml-conduit, xml-types

Files

Text/Markdown/Inline.hs view
@@ -14,6 +14,8 @@ import Data.Monoid (Monoid, mappend) import qualified Data.Map as Map import Text.Markdown.Types (Inline(..))+import Data.XML.Types (Content (..))+import Text.XML.Stream.Parse (decodeHtmlEntities)  type RefMap = Map.Map Text Text @@ -207,6 +209,7 @@         <|> rawent "&apos;"         <|> decEnt         <|> hexEnt+        <|> namedEnt      rawent t = InlineHtml <$> string t @@ -229,6 +232,14 @@             , t             , T.singleton c             ]++    namedEnt = do+        _s <- char '&'+        t <- takeWhile1 (/= ';')+        _c <- char ';'+        case decodeHtmlEntities t of+            ContentText t' -> return $ InlineHtml t'+            ContentEntity _ -> fail "Unknown named entity"  hrefChar :: Parser Char hrefChar = (char '\\' *> anyChar) <|> satisfy (notInClass " )")
markdown.cabal view
@@ -1,5 +1,5 @@ Name:                markdown-Version:             0.1.13.2+Version:             0.1.14 Synopsis:            Convert Markdown to HTML, with XSS protection Description:         This library leverages existing high-performance libraries (attoparsec, blaze-html, text, and conduit), and should integrate well with existing codebases. Homepage:            https://github.com/snoyberg/markdown@@ -31,6 +31,8 @@                      , data-default           >= 0.3                      , xss-sanitize           >= 0.3.3                      , containers+                     , xml-types+                     , xml-conduit   ghc-options:       -Wall  test-suite test
test/examples/entities.html view
@@ -1,1 +1,1 @@-<p>1 &lt; 2 &amp; 2 &gt; 1, also 1 &lt; 2 &amp; 2 &gt; 1   ý &amp;#xP;</p>+<p>1 &lt; 2 &amp; 2 &gt; 1, also 1 &lt; 2 &amp; 2 &gt; 1   ý &amp;#xP; …</p>
test/examples/entities.md view
@@ -1,1 +1,1 @@-1 < 2 & 2 > 1, also 1 &lt; 2 &amp; 2 &gt; 1 &#160; &#xfd; &#xP;+1 < 2 & 2 > 1, also 1 &lt; 2 &amp; 2 &gt; 1 &#160; &#xfd; &#xP; &hellip;