yesod-markdown 0.12.3 → 0.12.4
raw patch · 5 files changed
+177/−13 lines, 5 filesdep ~basedep ~pandoc
Dependency ranges changed: base, pandoc
Files
- CHANGELOG.md +150/−0
- README.md +2/−2
- src/Yesod/Markdown.hs +6/−1
- test/Spec.hs +12/−4
- yesod-markdown.cabal +7/−6
+ CHANGELOG.md view
@@ -0,0 +1,150 @@+## [*Unreleased*](https://github.com/pbrisbin/yesod-markdown/compare/v0.12.4...master)++None++## [v0.12.4](https://github.com/pbrisbin/yesod-markdown/compare/v0.12.3...v0.12.4)++- Support GHC 8.4 ([@waddlaw](https://github.com/pbrisbin/yesod-markdown/pull/51))++## [v0.12.3](https://github.com/pbrisbin/yesod-markdown/compare/v0.12.2...v0.12.3)++- Added `markdownToHtmlWith` & `markdownToHtmlWithExtensions`+- Deprecate internal conversion functions++## [v0.12.2](https://github.com/pbrisbin/yesod-markdown/compare/v0.12.1...v0.12.2)++- Allow yesod-1.6 ([@bitemyapp](https://github.com/pbrisbin/yesod-markdown/pull/43))++## [v0.12.1](https://github.com/pbrisbin/yesod-markdown/compare/v0.12.0...v0.12.1)++- Allow pandoc-2.1++## [v0.12.0](https://github.com/pbrisbin/yesod-markdown/compare/v0.11.4...v0.12.0)++- Require pandoc-2.0, support GHC 8.2 ([@cdepillabout](https://github.com/pbrisbin/yesod-markdown/pull/40))+- Drop GHC 7.10 support++## [v0.11.4](https://github.com/pbrisbin/yesod-markdown/compare/v0.11.3...v0.11.4)++- Allow blaze-html-0.9 and blaze-markup-0.8 ([@cdepillabout](https://github.com/pbrisbin/yesod-markdown/pull/39))++## [v0.11.3](https://github.com/pbrisbin/yesod-markdown/compare/v0.11.2...v0.11.3)++- Allow pandoc-1.19 ([@gfontenot](https://github.com/pbrisbin/yesod-markdown/pull/37))++## [v0.11.2](https://github.com/pbrisbin/yesod-markdown/compare/v0.11.1...v0.11.2)++*No changes*++## [v0.11.1](https://github.com/pbrisbin/yesod-markdown/compare/v0.11.0...v0.11.1)++- Allow pandoc-1.17 ([@andrewthad](https://github.com/pbrisbin/yesod-markdown/pull/36))++## [v0.11.0](https://github.com/pbrisbin/yesod-markdown/compare/v0.10.0...v0.11.0)++- Allow pandoc-1.16++## [v0.10.0](https://github.com/pbrisbin/yesod-markdown/compare/v0.9.4...v0.10.0)++- Require pandoc-1.14, support pandoc 1.15 ([@robgssp](https://github.com/pbrisbin/yesod-markdown/pull/31))++## [v0.9.4](https://github.com/pbrisbin/yesod-markdown/compare/v0.9.3.1...v0.9.4)++- Allow blaze-html-0.8 ([@geraldus](https://github.com/pbrisbin/yesod-markdown/pull/27))++## [v0.9.3.1](https://github.com/pbrisbin/yesod-markdown/compare/v0.9.3...v0.9.3.1)++- Correct license field ([@nkaretnikov](https://github.com/pbrisbin/yesod-markdown/pull/23))++## [v0.9.3](https://github.com/pbrisbin/yesod-markdown/compare/v0.9.2...v0.9.3)++- Allow yesod-1.4 ([@nek0](https://github.com/pbrisbin/yesod-markdown/pull/21))++## [v0.9.2](https://github.com/pbrisbin/yesod-markdown/compare/v0.9.1...v0.9.2)++- Allow pandoc-1.13 ([cosmo0920](https://github.com/pbrisbin/yesod-markdown/pull/19))++## [v0.9.1](https://github.com/pbrisbin/yesod-markdown/compare/v0.9.0...v0.9.1)++- Remove temporary < 1.2.0.2 workaround+- Add dependency bounds to avoid broken texmath-0.6.5.1++## [v0.9.0](https://github.com/pbrisbin/yesod-markdown/compare/v0.8.5...v0.9.0)++- Support shakespeare (renamed from hamlet package)++## [v0.8.5](https://github.com/pbrisbin/yesod-markdown/compare/v0.8.4...v0.8.5)++- Add upper bound on temporary-1.2.0.2+- Write `PersistFieldSql` instance by hand++## [v0.8.4](https://github.com/pbrisbin/yesod-markdown/compare/v0.8.3...v0.8.4)++- Allow text-1.\*+- Allow blaze-html-0.7 and blaze-markup-0.7++## [v0.8.3](https://github.com/pbrisbin/yesod-markdown/compare/v0.8.2...v0.8.3)++- Allow up to text-1.1 ([@trofi](https://github.com/pbrisbin/yesod-markdown/pull/14))+- Set `writerHighlight` ([@cosmo0920](https://github.com/pbrisbin/yesod-markdown/pull/15)))++## [v0.8.2](https://github.com/pbrisbin/yesod-markdown/compare/v0.8.1...v0.8.2)++- Allow pandoc-1.12 ([@cjwatson](https://github.com/pbrisbin/yesod-markdown/pull/13))++## [v0.8.1](https://github.com/pbrisbin/yesod-markdown/compare/v0.8.0...v0.8.1)++- Derive `PersistFieldSql`++## [v0.8.0](https://github.com/pbrisbin/yesod-markdown/compare/v0.7.2...v0.8.0)++- Support yesod-1.2 ([@gregwebs](https://github.com/pbrisbin/yesod-markdown/pull/12))++## [v0.7.2](https://github.com/pbrisbin/yesod-markdown/compare/v0.7.1...v0.7.2)++- Support yesod-1.1 ([@gregwebs](https://github.com/pbrisbin/yesod-markdown/pull/11))++## [v0.7.1](https://github.com/pbrisbin/yesod-markdown/compare/v0.7...v0.7.1)++- Trim `\r` from `textarea` content++## [v0.7](https://github.com/pbrisbin/yesod-markdown/compare/v0.6...v0.7)++- Fix reading content with UTF-8 characters++## [v0.6](https://github.com/pbrisbin/yesod-markdown/compare/v0.5.1...v0.6)++- Support pandoce-1.10++## [v0.5.1](https://github.com/pbrisbin/yesod-markdown/compare/v0.5.0...v0.5.1)++- Allow newer persistent ([@gregwebs](https://github.com/pbrisbin/yesod-markdown/pull/9))++## [v0.5.0](https://github.com/pbrisbin/yesod-markdown/compare/v0.4.1...v0.5.0)++- Require yesod-1.1 and yesod-form-1.2 ([@dlthomas](https://github.com/pbrisbin/yesod-markdown/pull/7))++## [v0.4.1](https://github.com/pbrisbin/yesod-markdown/compare/v0.4.0...v0.4.1)++- Require blaze-html 0.5 ([@lbolla](https://github.com/pbrisbin/yesod-markdown/pull/5))+- Allow yesod-1.1 ([@SimSaladin](https://github.com/pbrisbin/yesod-markdown/pull/6))++## [v0.4.0](https://github.com/pbrisbin/yesod-markdown/compare/v0.3.4...v0.4.0)++- Support yesod-1.0 ([@pSub](https://github.com/pbrisbin/yesod-markdown/pull/3))++## [v0.3.4](https://github.com/pbrisbin/yesod-markdown/compare/v0.3.3...v0.3.4)++- Drop GHC 6 support ([@pSub](https://github.com/pbrisbin/yesod-markdown/pull/2))++## [v0.3.3](https://github.com/pbrisbin/yesod-markdown/compare/v0.3.2...v0.3.3)++- Break up yesod dependency ([@gregwebs](https://github.com/pbrisbin/yesod-markdown/pull/1))++## [v0.3.2](https://github.com/pbrisbin/yesod-markdown/compare/v0.3.1...v0.3.2)++- Require pandoc-1.9++## [v0.3.1](https://github.com/pbrisbin/yesod-markdown/tree/v0.3.1)++This is the first version where we begin tracking changes.
README.md view
@@ -24,7 +24,7 @@ The default extensions are minimal, you can specify you're preferred [extensions][] with `markdownToHtmlWithExtensions`: -[extensions](http://hackage.haskell.org/package/pandoc/docs/Text-Pandoc-Extensions.html)+[extensions]: http://hackage.haskell.org/package/pandoc/docs/Text-Pandoc-Extensions.html ```haskell import Text.Pandoc.Extensions (githubMarkdownExtensions)@@ -33,7 +33,7 @@ getPageR fp = do content <- liftIO $ fmap (markdownToHtmlWithExtensions githubMarkdownExtensions)- $ markdownFromFile fp)+ $ markdownFromFile fp defaultLayout $ do [shamlet|
src/Yesod/Markdown.hs view
@@ -1,3 +1,4 @@+{-# LANGUAGE CPP #-} {-# LANGUAGE ExplicitForAll #-} {-# LANGUAGE FlexibleContexts #-} {-# LANGUAGE FlexibleInstances #-}@@ -48,8 +49,12 @@ import qualified Data.ByteString as B import qualified Data.Text as T +#if !MIN_VERSION_base(4,11,0)+import Data.Semigroup+#endif+ newtype Markdown = Markdown { unMarkdown :: Text }- deriving (Eq, Ord, Show, Read, PersistField, IsString, Monoid)+ deriving (Eq, Ord, Show, Read, PersistField, IsString, Monoid, Semigroup) instance PersistFieldSql Markdown where sqlType _ = SqlString
test/Spec.hs view
@@ -14,7 +14,8 @@ spec :: Spec spec = describe "Yesod.Markdown" $ do it "converts Markdown to sanitized HTML" $ do- let markdown = Markdown $ T.unlines+ let+ markdown = Markdown $ T.unlines [ "# Title" , "" , "- one"@@ -28,18 +29,25 @@ let Right html = markdownToHtml markdown - renderHtml html `shouldBe` TL.concat+ let rendered = renderHtml html+ rendered `shouldBe` TL.concat [ "<h1 id=\"title\">Title</h1>" , "<ul>" , "<li>one</li>" , "<li>two</li>" , "<li>three</li>" , "</ul>"- , "\n alert('xxs');\n"+ -- pandoc-2.2.3 changes quote escaping in a minor way that we don't+ -- care about. CPP is annoying, so let's just make the assertion+ -- dynamic+ , if "'" `TL.isInfixOf` rendered+ then "\n alert('xxs');\n"+ else "\n alert('xxs');\n" ] it "converts Markdown to unsanitized HTML" $ do- let markdown = Markdown $ T.unlines+ let+ markdown = Markdown $ T.unlines [ "# Title" , "" , "- one"
yesod-markdown.cabal view
@@ -1,11 +1,13 @@--- This file has been generated from package.yaml by hpack version 0.20.0.+cabal-version: 1.12++-- This file has been generated from package.yaml by hpack version 0.31.0. -- -- see: https://github.com/sol/hpack ----- hash: b7e83808360b85c8c862b1daa225c4a7fa6509a8084cbab7a2933e66ee33be18+-- hash: 29a76d05b3f96d9971cf552b8273b023b81763b7c670b93831161dad4a1308fe name: yesod-markdown-version: 0.12.3+version: 0.12.4 synopsis: Tools for using markdown in a yesod application description: A subset of Pandoc functionality useful for markdown processing in yesod applications category: Web, Yesod@@ -16,10 +18,9 @@ license: GPL-2 license-file: LICENSE build-type: Simple-cabal-version: >= 1.10- extra-source-files: README.md+ CHANGELOG.md source-repository head type: git@@ -35,7 +36,7 @@ , blaze-markup >=0.5 && <0.9 , bytestring >=0.9 && <0.11 , directory- , pandoc >=2.0 && <2.2+ , pandoc >=2.0 && <2.3 , persistent >=0.9 , shakespeare >=2.0 && <2.1 , text >=0.11 && <2.0