cheapskate 0.1 → 0.1.0.1
raw patch · 4 files changed
+24/−10 lines, 4 filesdep ~blaze-htmldep ~text
Dependency ranges changed: blaze-html, text
Files
- Cheapskate/Inlines.hs +9/−4
- README.markdown +1/−1
- changelog +8/−0
- cheapskate.cabal +6/−5
Cheapskate/Inlines.hs view
@@ -10,7 +10,7 @@ import Cheapskate.Types import Data.Char hiding (Space) import qualified Data.Sequence as Seq-import Data.Sequence (singleton, (<|))+import Data.Sequence (singleton, (<|), viewl, ViewL(..)) import Prelude hiding (takeWhile) import Control.Applicative import Data.Monoid@@ -370,9 +370,14 @@ pImage :: ReferenceMap -> Parser Inlines pImage refmap = do char '!'- let linkToImage (Link lab url tit) = Image lab url tit- linkToImage x = x- fmap linkToImage <$> pLink refmap+ (linkToImage <$> pLink refmap) <|> return (singleton (Str "!"))++linkToImage :: Inlines -> Inlines+linkToImage ils =+ case viewl ils of+ (Link lab url tit :< x)+ | Seq.null x -> singleton (Image lab url tit)+ _ -> singleton (Str "!") <> ils -- An entity. We store these in a special inline element. -- This ensures that entities in the input come out as
README.markdown view
@@ -45,7 +45,7 @@ raw HTML or a markdown link or image attribute attribute. You may also wish to disallow users from entering raw HTML for aesthetic,-rather than security reasons. In that case, set `allowRawHtml` to `True`,+rather than security reasons. In that case, set `allowRawHtml` to `False`, but let `sanitize` stay `True`, since it still affects attributes coming from markdown links and images.
+ changelog view
@@ -0,0 +1,8 @@+cheapskate 0.1.0.1 (10 Mar 2014)++ * Increased version bounds for text, blaze-html.+ * Made pImage more efficient, avoiding backtracking.++cheapskate 0.1 (05 Jan 2014)++ * Initial release.
cheapskate.cabal view
@@ -1,5 +1,5 @@ name: cheapskate-version: 0.1+version: 0.1.0.1 synopsis: Experimental markdown processor. description: This is an experimental Markdown processor in pure Haskell. It aims to process Markdown efficiently and in@@ -20,6 +20,7 @@ category: Text build-type: Simple extra-source-files: README.markdown+ changelog man/man1/cheapskate.1 cabal-version: >=1.10 Source-repository head@@ -38,8 +39,8 @@ build-depends: base >=4.4 && <4.8, containers >=0.4 && <0.6, mtl >=2.1 && <2.2,- text >= 0.9 && <1.1,- blaze-html >=0.6 && <0.7,+ text >= 0.9 && < 1.2,+ blaze-html >=0.6 && < 0.8, xss-sanitize >= 0.3 && < 0.4, data-default >= 0.5 && < 0.6, syb,@@ -55,8 +56,8 @@ build-depends: base >=4.4 && <4.8, cheapskate, bytestring,- blaze-html >=0.6 && <0.7,- text >= 0.9 && <1.1+ blaze-html >=0.6 && < 0.8,+ text >= 0.9 && < 1.2 default-language: Haskell2010 ghc-options: -Wall -fno-warn-unused-do-bind ghc-prof-options: -auto-all -caf-all -rtsopts