sundown 0.5.0.2 → 0.5.1
raw patch · 3 files changed
+13/−24 lines, 3 files
Files
- src/Text/Sundown/Html/String.hs +5/−11
- src/Text/Sundown/Html/Text.hs +7/−12
- sundown.cabal +1/−1
src/Text/Sundown/Html/String.hs view
@@ -11,27 +11,21 @@ , allHtmlModes ) where -import qualified Data.ByteString.UTF8 as BS--import Text.Sundown.Html.ByteString- (noHtmlModes, allHtmlModes, HtmlRenderMode(..))-import qualified Text.Sundown.Html.ByteString as SundownBS-import Text.Sundown.Foreign+import Text.Sundown.Html hiding (renderHtml, smartypants)+import qualified Text.Sundown.Html as Sundown -- | Parses a 'ByteString' containing the markdown, returns the Html code. renderHtml :: String -> Extensions -> HtmlRenderMode- -> Bool -- ^ If true, smartypant the output + -> Bool -- ^ If true, smartypant the output -> Maybe Int -- ^ The maximum nesting of the HTML. If Nothing, a default value -- (16) will be used. -> String-renderHtml input exts mode sp maxNestingM = - BS.toString $ SundownBS.renderHtml (BS.fromString input) exts mode- sp maxNestingM+renderHtml = Sundown.renderHtml -- | Converts punctuation in Html entities, -- <http://daringfireball.net/projects/smartypants/> smartypants :: String -> String-smartypants = BS.toString . SundownBS.smartypants . BS.fromString+smartypants = Sundown.smartypants
src/Text/Sundown/Html/Text.hs view
@@ -1,38 +1,33 @@ module Text.Sundown.Html.Text ( renderHtml , smartypants- -- * Markdown extensions + -- * Markdown extensions , Extensions (..) , allExtensions , noExtensions- -- * Html render modes + -- * Html render modes , HtmlRenderMode(..) , noHtmlModes , allHtmlModes ) where import Data.Text (Text)-import Data.Text.Encoding -import Text.Sundown.Html.ByteString- (noHtmlModes, allHtmlModes, HtmlRenderMode(..))-import qualified Text.Sundown.Html.ByteString as SundownBS-import Text.Sundown.Foreign+import Text.Sundown.Html hiding (renderHtml, smartypants)+import qualified Text.Sundown.Html as Sundown -- | Parses a 'ByteString' containing the markdown, returns the Html code. renderHtml :: Text -> Extensions -> HtmlRenderMode- -> Bool -- ^ If true, smartypant the output + -> Bool -- ^ If true, smartypant the output -> Maybe Int -- ^ The maximum nesting of the HTML. If Nothing, a default value -- (16) will be used. -> Text-renderHtml input exts mode sp maxNestingM = - decodeUtf8 $ SundownBS.renderHtml (encodeUtf8 input) exts mode sp- maxNestingM+renderHtml = Sundown.renderHtml -- | Converts punctuation in Html entities, -- <http://daringfireball.net/projects/smartypants/> smartypants :: Text -> Text-smartypants = decodeUtf8 . SundownBS.smartypants . encodeUtf8+smartypants = Sundown.smartypants
sundown.cabal view
@@ -1,6 +1,6 @@ Cabal-version: >= 1.6 Name: sundown-Version: 0.5.0.2+Version: 0.5.1 Author: Francesco Mazzoli (f@mazzo.li) Maintainer: Francesco Mazzoli (f@mazzo.li) Build-Type: Simple