git.iko.soy/typeable/pandoc
on master help sign in
Merge pull request #496 from markwright/master

changes for blaze-html 0.5

commita0fa8f92f1eb1e2678f1d1e1bd9f86d6a1bfa9d5 authorJohn MacFarlane <jgm@berkeley.edu> dateTue 24 Apr 2012, 14:40 (14 years ago) parent869ff43471d4dc
3 files changed+36−5
pandoc.cabal+24−3 src/Text/Pandoc/Templates.hs+6−1 src/Text/Pandoc/Writers/HTML.hs+6−1
pandoc.cabal+24−3
@@ -185,6 +185,9 @@ Flag library
185185Flag tests
186186 Description: Build test-pandoc.
187187 Default: False
188+Flag blaze_html_0_5
189+ Description: Use blaze-html 0.5 and blaze-markup 0.5
190+ Default: False
188191
189192Library
190193 -- Note: the following is duplicated in all stanzas.
@@ -192,7 +195,6 @@ Library
192195 -- BEGIN DUPLICATED SECTION
193196 Build-Depends: containers >= 0.1 && < 0.5,
194197 parsec >= 3.1 && < 3.2,
195− blaze-html >= 0.4.3.0 && < 0.5,
196198 mtl >= 1.1 && < 2.2,
197199 network >= 2 && < 2.4,
198200 filepath >= 1.1 && < 1.4,
@@ -216,6 +218,13 @@ Library
216218 zlib >= 0.5 && < 0.6,
217219 highlighting-kate >= 0.5.0.2 && < 0.6,
218220 temporary >= 1.1 && < 1.2
221+ if flag(blaze_html_0_5)
222+ build-depends:
223+ blaze-html >= 0.5 && < 0.6,
224+ blaze-markup >= 0.5.1 && < 0.6
225+ else
226+ build-depends:
227+ blaze-html >= 0.4.3.0 && < 0.5
219228 if impl(ghc >= 6.10)
220229 Build-depends: base >= 4 && < 5, syb >= 0.1 && < 0.4
221230 else
@@ -291,7 +300,6 @@ Executable pandoc
291300 -- BEGIN DUPLICATED SECTION
292301 Build-Depends: containers >= 0.1 && < 0.5,
293302 parsec >= 3.1 && < 3.2,
294− blaze-html >= 0.4.3.0 && < 0.5,
295303 mtl >= 1.1 && < 2.2,
296304 network >= 2 && < 2.4,
297305 filepath >= 1.1 && < 1.4,
@@ -315,6 +323,13 @@ Executable pandoc
315323 zlib >= 0.5 && < 0.6,
316324 highlighting-kate >= 0.5.0.2 && < 0.6,
317325 temporary >= 1.1 && < 1.2
326+ if flag(blaze_html_0_5)
327+ build-depends:
328+ blaze-html >= 0.5 && < 0.6,
329+ blaze-markup >= 0.5.1 && < 0.6
330+ else
331+ build-depends:
332+ blaze-html >= 0.4.3.0 && < 0.5
318333 if impl(ghc >= 6.10)
319334 Build-depends: base >= 4 && < 5, syb >= 0.1 && < 0.4
320335 else
@@ -349,7 +364,6 @@ Executable test-pandoc
349364 -- BEGIN DUPLICATED SECTION
350365 Build-Depends: containers >= 0.1 && < 0.5,
351366 parsec >= 3.1 && < 3.2,
352− blaze-html >= 0.4.3.0 && < 0.5,
353367 mtl >= 1.1 && < 2.2,
354368 network >= 2 && < 2.4,
355369 filepath >= 1.1 && < 1.4,
@@ -373,6 +387,13 @@ Executable test-pandoc
373387 zlib >= 0.5 && < 0.6,
374388 highlighting-kate >= 0.5.0.2 && < 0.6,
375389 temporary >= 1.1 && < 1.2
390+ if flag(blaze_html_0_5)
391+ build-depends:
392+ blaze-html >= 0.5 && < 0.6,
393+ blaze-markup >= 0.5.1 && < 0.6
394+ else
395+ build-depends:
396+ blaze-html >= 0.4.3.0 && < 0.5
376397 if impl(ghc >= 6.10)
377398 Build-depends: base >= 4 && < 5, syb >= 0.1 && < 0.4
378399 else
src/Text/Pandoc/Templates.hs+6−1
@@ -1,4 +1,4 @@
1−{-# LANGUAGE TypeSynonymInstances, FlexibleInstances #-}
1+{-# LANGUAGE TypeSynonymInstances, FlexibleInstances, CPP #-}
22{-
33Copyright (C) 2009-2010 John MacFarlane <jgm@berkeley.edu>
44
@@ -72,7 +72,12 @@ import Text.ParserCombinators.Parsec
7272import Control.Monad (liftM, when, forM)
7373import System.FilePath
7474import Data.List (intercalate, intersperse)
75+#if MIN_VERSION_blaze_html(0,5,0)
76+import Text.Blaze.Html (Html)
77+import Text.Blaze.Internal (preEscapedString)
78+#else
7579import Text.Blaze (preEscapedString, Html)
80+#endif
7681import Data.ByteString.Lazy.UTF8 (ByteString, fromString)
7782import Text.Pandoc.Shared (readDataFile)
7883import qualified Control.Exception.Extensible as E (try, IOException)
src/Text/Pandoc/Writers/HTML.hs+6−1
@@ -1,4 +1,4 @@
1−{-# LANGUAGE OverloadedStrings #-}
1+{-# LANGUAGE OverloadedStrings, CPP #-}
22{-# OPTIONS_GHC -fno-warn-deprecations #-}
33{-
44Copyright (C) 2006-2010 John MacFarlane <jgm@berkeley.edu>
@@ -46,7 +46,12 @@ import Data.List ( isPrefixOf, intersperse )
4646import Data.String ( fromString )
4747import Data.Maybe ( catMaybes )
4848import Control.Monad.State
49+#if MIN_VERSION_blaze_html(0,5,0)
50+import Text.Blaze.Html hiding(contents)
51+import Text.Blaze.Internal(preEscapedString)
52+#else
4953import Text.Blaze
54+#endif
5055import qualified Text.Blaze.Html5 as H5
5156import qualified Text.Blaze.XHtml1.Transitional as H
5257import qualified Text.Blaze.XHtml1.Transitional.Attributes as A