aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohn MacFarlane <fiddlosopher@gmail.com>2013-01-07 20:12:05 -0800
committerJohn MacFarlane <fiddlosopher@gmail.com>2013-01-07 20:12:05 -0800
commit7909982f9a17bddb69803b8779ed3d3587844f84 (patch)
tree57adbdd1501de4f8e9d83f78ff8534a76fe98d7b
parent8c48bd8feb97e6c291df2e0ca09f62fb34711d33 (diff)
downloadpandoc-7909982f9a17bddb69803b8779ed3d3587844f84.tar.gz
Shared: export isTightList.
-rw-r--r--src/Text/Pandoc/Shared.hs7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/Text/Pandoc/Shared.hs b/src/Text/Pandoc/Shared.hs
index 7bd35b138..648086fd4 100644
--- a/src/Text/Pandoc/Shared.hs
+++ b/src/Text/Pandoc/Shared.hs
@@ -60,6 +60,7 @@ module Text.Pandoc.Shared (
uniqueIdent,
isHeaderBlock,
headerShift,
+ isTightList,
-- * TagSoup HTML handling
renderTags',
-- * File handling
@@ -475,6 +476,12 @@ headerShift n = bottomUp shift
shift (Header level inner) = Header (level + n) inner
shift x = x
+-- | Detect if a list is tight.
+isTightList :: [[Block]] -> Bool
+isTightList = and . map firstIsPlain
+ where firstIsPlain (Plain _ : _) = True
+ firstIsPlain _ = False
+
--
-- TagSoup HTML handling
--