git.iko.soy/typeable/pandoc
on master help sign in
Restore xhtml style self-closed tags in HTML writer.
5ff7f81John MacFarlane
pandoc.cabal+2−2
@@ -204,7 +204,7 @@ Library
204 -- BEGIN DUPLICATED SECTION
204 -- BEGIN DUPLICATED SECTION
205 Build-Depends: containers >= 0.1 && < 0.5,
205 Build-Depends: containers >= 0.1 && < 0.5,
206 parsec >= 2.1 && < 3.2,
206 parsec >= 2.1 && < 3.2,
207− blaze-html >= 0.4 && < 0.5,
207+ blaze-html >= 0.4.3.0 && < 0.5,
208 mtl >= 1.1 && < 2.1,
208 mtl >= 1.1 && < 2.1,
209 network >= 2 && < 2.4,
209 network >= 2 && < 2.4,
210 filepath >= 1.1 && < 1.3,
210 filepath >= 1.1 && < 1.3,
@@ -292,7 +292,7 @@ Executable pandoc
292 -- BEGIN DUPLICATED SECTION
292 -- BEGIN DUPLICATED SECTION
293 Build-Depends: containers >= 0.1 && < 0.5,
293 Build-Depends: containers >= 0.1 && < 0.5,
294 parsec >= 2.1 && < 3.2,
294 parsec >= 2.1 && < 3.2,
295− blaze-html >= 0.4 && < 0.5,
295+ blaze-html >= 0.4.3.0 && < 0.5,
296 mtl >= 1.1 && < 2.1,
296 mtl >= 1.1 && < 2.1,
297 network >= 2 && < 2.4,
297 network >= 2 && < 2.4,
298 filepath >= 1.1 && < 1.3,
298 filepath >= 1.1 && < 1.3,
src/Text/Pandoc/Writers/HTML.hs+9−9
@@ -45,9 +45,9 @@ import Data.String ( fromString )
45import Data.Maybe ( catMaybes )
45import Data.Maybe ( catMaybes )
46import Control.Monad.State
46import Control.Monad.State
47import Text.Blaze
47import Text.Blaze
48−import qualified Text.Blaze.Html5 as H
48+import qualified Text.Blaze.Html5 as H5
49+import qualified Text.Blaze.XHtml1.Transitional as H
49−import qualified Text.Blaze.Html5.Attributes as A
50+import qualified Text.Blaze.XHtml1.Transitional.Attributes as A
50−import qualified Text.Blaze.Html4.Transitional.Attributes as A4
51import Text.Blaze.Renderer.String (renderHtml)
51import Text.Blaze.Renderer.String (renderHtml)
52import Text.TeXMath
52import Text.TeXMath
53import Text.XML.Light.Output
53import Text.XML.Light.Output
@@ -252,7 +252,7 @@ elementToHtml opts (Sec level num id' title' elements) = do
252 ["level" ++ show level]
252 ["level" ++ show level]
253 let inNl x = mconcat $ nl opts : intersperse (nl opts) x ++ [nl opts]
253 let inNl x = mconcat $ nl opts : intersperse (nl opts) x ++ [nl opts]
254 let secttag = if writerHtml5 opts
254 let secttag = if writerHtml5 opts
255− then H.section ! A.class_ (toValue $ unwords classes)
255+ then H5.section ! A.class_ (toValue $ unwords classes)
256 else H.div ! A.class_ (toValue $ unwords ("section":classes))
256 else H.div ! A.class_ (toValue $ unwords ("section":classes))
257 return $ if writerSectionDivs opts || slide
257 return $ if writerSectionDivs opts || slide
258 then secttag ! prefixedId opts id' $ inNl stuff
258 then secttag ! prefixedId opts id' $ inNl stuff
@@ -268,7 +268,7 @@ footnoteSection opts notes =
268 $ nl opts >> H.hr >> nl opts >>
268 $ nl opts >> H.hr >> nl opts >>
269 H.ol (mconcat notes >> nl opts))
269 H.ol (mconcat notes >> nl opts))
270 where container x = if writerHtml5 opts
270 where container x = if writerHtml5 opts
271− then H.section ! A.class_ "footnotes" $ x
271+ then H5.section ! A.class_ "footnotes" $ x
272 else if writerSlideVariant opts /= NoSlides
272 else if writerSlideVariant opts /= NoSlides
273 then H.div ! A.class_ "footnotes slide" $ x
273 then H.div ! A.class_ "footnotes slide" $ x
274 else H.div ! A.class_ "footnotes" $ x
274 else H.div ! A.class_ "footnotes" $ x
@@ -349,8 +349,8 @@ blockToHtml opts (Para [Image txt (s,tit)]) = do
349 img <- inlineToHtml opts (Image txt (s,tit))
349 img <- inlineToHtml opts (Image txt (s,tit))
350 capt <- inlineListToHtml opts txt
350 capt <- inlineListToHtml opts txt
351 return $ if writerHtml5 opts
351 return $ if writerHtml5 opts
352− then H.figure $ mconcat
352+ then H5.figure $ mconcat
353− [nl opts, img, H.figcaption capt, nl opts]
353+ [nl opts, img, H5.figcaption capt, nl opts]
354 else H.div ! A.class_ "figure" $ mconcat
354 else H.div ! A.class_ "figure" $ mconcat
355 [nl opts, img, H.p ! A.class_ "caption" $ capt,
355 [nl opts, img, H.p ! A.class_ "caption" $ capt,
356 nl opts]
356 nl opts]
@@ -508,7 +508,7 @@ tableItemToHtml opts tag' align' item = do
508 let alignStr = alignmentToString align'
508 let alignStr = alignmentToString align'
509 let attribs = if writerHtml5 opts
509 let attribs = if writerHtml5 opts
510 then A.style (toValue $ "text-align: " ++ alignStr ++ ";")
510 then A.style (toValue $ "text-align: " ++ alignStr ++ ";")
511− else A4.align (toValue alignStr)
511+ else A.align (toValue alignStr)
512 return $ (tag' ! attribs $ contents) >> nl opts
512 return $ (tag' ! attribs $ contents) >> nl opts
513
513
514toListItems :: WriterOptions -> [Html] -> [Html]
514toListItems :: WriterOptions -> [Html] -> [Html]
@@ -641,7 +641,7 @@ inlineToHtml opts inline =
641 (if null tit
641 (if null tit
642 then []
642 then []
643 else [A.title $ toValue tit])
643 else [A.title $ toValue tit])
644− return $ foldl (!) H.embed attributes
644+ return $ foldl (!) H5.embed attributes
645 -- note: null title included, as in Markdown.pl
645 -- note: null title included, as in Markdown.pl
646 (Note contents) -> do
646 (Note contents) -> do
647 st <- get
647 st <- get