aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorfiddlosopher <fiddlosopher@788f1e2b-df1e-0410-8736-df70ead52e1b>2007-07-09 00:50:14 +0000
committerfiddlosopher <fiddlosopher@788f1e2b-df1e-0410-8736-df70ead52e1b>2007-07-09 00:50:14 +0000
commit489a2bb1d9d9f8473f5e11cb6c74b5c6f5e9c866 (patch)
tree5dd492fc1e6614f70b86d28956941703eb6b9109 /src
parent2d4a22d0be7e2da288c4af43250d6d3c607ccf8b (diff)
downloadpandoc-489a2bb1d9d9f8473f5e11cb6c74b5c6f5e9c866.tar.gz
Moved isHeaderBlock from Text.Pandoc.Writers.HTML
to Text.Pandoc.Shared. git-svn-id: https://pandoc.googlecode.com/svn/trunk@656 788f1e2b-df1e-0410-8736-df70ead52e1b
Diffstat (limited to 'src')
-rw-r--r--src/Text/Pandoc/Shared.hs6
-rw-r--r--src/Text/Pandoc/Writers/HTML.hs5
2 files changed, 6 insertions, 5 deletions
diff --git a/src/Text/Pandoc/Shared.hs b/src/Text/Pandoc/Shared.hs
index eedd7d71a..ee6c19a4c 100644
--- a/src/Text/Pandoc/Shared.hs
+++ b/src/Text/Pandoc/Shared.hs
@@ -63,6 +63,7 @@ module Text.Pandoc.Shared (
compactify,
Element (..),
hierarchicalize,
+ isHeaderBlock,
-- * Writer options
WriterOptions (..),
defaultWriterOptions,
@@ -390,6 +391,11 @@ hierarchicalize (block:rest) =
(hierarchicalize rest')
x -> (Blk x):(hierarchicalize rest)
+-- | True if block is a Header block.
+isHeaderBlock :: Block -> Bool
+isHeaderBlock (Header _ _) = True
+isHeaderBlock _ = False
+
-- | Options for writers
data WriterOptions = WriterOptions
{ writerStandalone :: Bool -- ^ Include header and footer
diff --git a/src/Text/Pandoc/Writers/HTML.hs b/src/Text/Pandoc/Writers/HTML.hs
index c3ed92f5c..4ed6a3ce9 100644
--- a/src/Text/Pandoc/Writers/HTML.hs
+++ b/src/Text/Pandoc/Writers/HTML.hs
@@ -87,11 +87,6 @@ writeHtml opts (Pandoc (Meta tit authors date) blocks) =
then head +++ (body thebody)
else thebody
--- | True if block is a Header block.
-isHeaderBlock :: Block -> Bool
-isHeaderBlock (Header _ _) = True
-isHeaderBlock _ = False
-
-- | Construct table of contents from list of header blocks and identifiers.
-- Assumes there are as many identifiers as header blocks.
tableOfContents :: WriterOptions -> [Block] -> Ids -> Html