git.iko.soy/typeable/pandoc
on master help sign in
Merge pull request #496 from markwright/master
a0fa8f9John MacFarlane
pandoc.cabal+24−3
@@ -185,6 +185,9 @@ Flag library
185Flag tests
185Flag tests
186 Description: Build test-pandoc.
186 Description: Build test-pandoc.
187 Default: False
187 Default: False
188+Flag blaze_html_0_5
189+ Description: Use blaze-html 0.5 and blaze-markup 0.5
190+ Default: False
188
191
189Library
192Library
190 -- Note: the following is duplicated in all stanzas.
193 -- Note: the following is duplicated in all stanzas.
@@ -192,7 +195,6 @@ Library
192 -- BEGIN DUPLICATED SECTION
195 -- BEGIN DUPLICATED SECTION
193 Build-Depends: containers >= 0.1 && < 0.5,
196 Build-Depends: containers >= 0.1 && < 0.5,
194 parsec >= 3.1 && < 3.2,
197 parsec >= 3.1 && < 3.2,
195− blaze-html >= 0.4.3.0 && < 0.5,
196 mtl >= 1.1 && < 2.2,
198 mtl >= 1.1 && < 2.2,
197 network >= 2 && < 2.4,
199 network >= 2 && < 2.4,
198 filepath >= 1.1 && < 1.4,
200 filepath >= 1.1 && < 1.4,
@@ -216,6 +218,13 @@ Library
216 zlib >= 0.5 && < 0.6,
218 zlib >= 0.5 && < 0.6,
217 highlighting-kate >= 0.5.0.2 && < 0.6,
219 highlighting-kate >= 0.5.0.2 && < 0.6,
218 temporary >= 1.1 && < 1.2
220 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
219 if impl(ghc >= 6.10)
228 if impl(ghc >= 6.10)
220 Build-depends: base >= 4 && < 5, syb >= 0.1 && < 0.4
229 Build-depends: base >= 4 && < 5, syb >= 0.1 && < 0.4
221 else
230 else
@@ -291,7 +300,6 @@ Executable pandoc
291 -- BEGIN DUPLICATED SECTION
300 -- BEGIN DUPLICATED SECTION
292 Build-Depends: containers >= 0.1 && < 0.5,
301 Build-Depends: containers >= 0.1 && < 0.5,
293 parsec >= 3.1 && < 3.2,
302 parsec >= 3.1 && < 3.2,
294− blaze-html >= 0.4.3.0 && < 0.5,
295 mtl >= 1.1 && < 2.2,
303 mtl >= 1.1 && < 2.2,
296 network >= 2 && < 2.4,
304 network >= 2 && < 2.4,
297 filepath >= 1.1 && < 1.4,
305 filepath >= 1.1 && < 1.4,
@@ -315,6 +323,13 @@ Executable pandoc
315 zlib >= 0.5 && < 0.6,
323 zlib >= 0.5 && < 0.6,
316 highlighting-kate >= 0.5.0.2 && < 0.6,
324 highlighting-kate >= 0.5.0.2 && < 0.6,
317 temporary >= 1.1 && < 1.2
325 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
318 if impl(ghc >= 6.10)
333 if impl(ghc >= 6.10)
319 Build-depends: base >= 4 && < 5, syb >= 0.1 && < 0.4
334 Build-depends: base >= 4 && < 5, syb >= 0.1 && < 0.4
320 else
335 else
@@ -349,7 +364,6 @@ Executable test-pandoc
349 -- BEGIN DUPLICATED SECTION
364 -- BEGIN DUPLICATED SECTION
350 Build-Depends: containers >= 0.1 && < 0.5,
365 Build-Depends: containers >= 0.1 && < 0.5,
351 parsec >= 3.1 && < 3.2,
366 parsec >= 3.1 && < 3.2,
352− blaze-html >= 0.4.3.0 && < 0.5,
353 mtl >= 1.1 && < 2.2,
367 mtl >= 1.1 && < 2.2,
354 network >= 2 && < 2.4,
368 network >= 2 && < 2.4,
355 filepath >= 1.1 && < 1.4,
369 filepath >= 1.1 && < 1.4,
@@ -373,6 +387,13 @@ Executable test-pandoc
373 zlib >= 0.5 && < 0.6,
387 zlib >= 0.5 && < 0.6,
374 highlighting-kate >= 0.5.0.2 && < 0.6,
388 highlighting-kate >= 0.5.0.2 && < 0.6,
375 temporary >= 1.1 && < 1.2
389 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
376 if impl(ghc >= 6.10)
397 if impl(ghc >= 6.10)
377 Build-depends: base >= 4 && < 5, syb >= 0.1 && < 0.4
398 Build-depends: base >= 4 && < 5, syb >= 0.1 && < 0.4
378 else
399 else
src/Text/Pandoc/Templates.hs+6−1
@@ -1,4 +1,4 @@
1−{-# LANGUAGE TypeSynonymInstances, FlexibleInstances #-}
1+{-# LANGUAGE TypeSynonymInstances, FlexibleInstances, CPP #-}
2{-
2{-
3Copyright (C) 2009-2010 John MacFarlane <jgm@berkeley.edu>
3Copyright (C) 2009-2010 John MacFarlane <jgm@berkeley.edu>
4
4
@@ -72,7 +72,12 @@ import Text.ParserCombinators.Parsec
72import Control.Monad (liftM, when, forM)
72import Control.Monad (liftM, when, forM)
73import System.FilePath
73import System.FilePath
74import Data.List (intercalate, intersperse)
74import 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
75import Text.Blaze (preEscapedString, Html)
79import Text.Blaze (preEscapedString, Html)
80+#endif
76import Data.ByteString.Lazy.UTF8 (ByteString, fromString)
81import Data.ByteString.Lazy.UTF8 (ByteString, fromString)
77import Text.Pandoc.Shared (readDataFile)
82import Text.Pandoc.Shared (readDataFile)
78import qualified Control.Exception.Extensible as E (try, IOException)
83import 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 #-}
2{-# OPTIONS_GHC -fno-warn-deprecations #-}
2{-# OPTIONS_GHC -fno-warn-deprecations #-}
3{-
3{-
4Copyright (C) 2006-2010 John MacFarlane <jgm@berkeley.edu>
4Copyright (C) 2006-2010 John MacFarlane <jgm@berkeley.edu>
@@ -46,7 +46,12 @@ import Data.List ( isPrefixOf, intersperse )
46import Data.String ( fromString )
46import Data.String ( fromString )
47import Data.Maybe ( catMaybes )
47import Data.Maybe ( catMaybes )
48import Control.Monad.State
48import 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
49import Text.Blaze
53import Text.Blaze
54+#endif
50import qualified Text.Blaze.Html5 as H5
55import qualified Text.Blaze.Html5 as H5
51import qualified Text.Blaze.XHtml1.Transitional as H
56import qualified Text.Blaze.XHtml1.Transitional as H
52import qualified Text.Blaze.XHtml1.Transitional.Attributes as A
57import qualified Text.Blaze.XHtml1.Transitional.Attributes as A