summaryrefslogtreecommitdiff
path: root/src/Text/Pandoc/Readers/Docx/Lists.hs
diff options
context:
space:
mode:
authorJohn MacFarlane <jgm@berkeley.edu>2017-03-04 13:03:41 +0100
committerJohn MacFarlane <jgm@berkeley.edu>2017-03-04 13:03:41 +0100
commite256c8ce1778ff6fbb2e8d59556d48fb3c53393d (patch)
tree3527320cd3fd205a00a733ddbe46917638253034 /src/Text/Pandoc/Readers/Docx/Lists.hs
parent0edfbf1478950d645ece19ced0156771ba16ebb6 (diff)
Stylish-haskell automatic formatting changes.
Diffstat (limited to 'src/Text/Pandoc/Readers/Docx/Lists.hs')
-rw-r--r--src/Text/Pandoc/Readers/Docx/Lists.hs30
1 files changed, 15 insertions, 15 deletions
diff --git a/src/Text/Pandoc/Readers/Docx/Lists.hs b/src/Text/Pandoc/Readers/Docx/Lists.hs
index 395a53907..94b4d919a 100644
--- a/src/Text/Pandoc/Readers/Docx/Lists.hs
+++ b/src/Text/Pandoc/Readers/Docx/Lists.hs
@@ -33,38 +33,38 @@ module Text.Pandoc.Readers.Docx.Lists ( blocksToBullets
, listParagraphDivs
) where
-import Text.Pandoc.JSON
-import Text.Pandoc.Generic (bottomUp)
-import Text.Pandoc.Shared (trim)
import Control.Monad
import Data.List
import Data.Maybe
+import Text.Pandoc.Generic (bottomUp)
+import Text.Pandoc.JSON
+import Text.Pandoc.Shared (trim)
isListItem :: Block -> Bool
isListItem (Div (_, classes, _) _) | "list-item" `elem` classes = True
-isListItem _ = False
+isListItem _ = False
getLevel :: Block -> Maybe Integer
getLevel (Div (_, _, kvs) _) = liftM read $ lookup "level" kvs
-getLevel _ = Nothing
+getLevel _ = Nothing
getLevelN :: Block -> Integer
getLevelN b = case getLevel b of
- Just n -> n
+ Just n -> n
Nothing -> -1
getNumId :: Block -> Maybe Integer
getNumId (Div (_, _, kvs) _) = liftM read $ lookup "num-id" kvs
-getNumId _ = Nothing
+getNumId _ = Nothing
getNumIdN :: Block -> Integer
getNumIdN b = case getNumId b of
- Just n -> n
+ Just n -> n
Nothing -> -1
getText :: Block -> Maybe String
getText (Div (_, _, kvs) _) = lookup "text" kvs
-getText _ = Nothing
+getText _ = Nothing
data ListType = Itemized | Enumerated ListAttributes
@@ -162,7 +162,7 @@ flatToBullets elems = flatToBullets' (-1) elems
singleItemHeaderToHeader :: Block -> Block
singleItemHeaderToHeader (OrderedList _ [[h@(Header _ _ _)]]) = h
-singleItemHeaderToHeader blk = blk
+singleItemHeaderToHeader blk = blk
blocksToBullets :: [Block] -> [Block]
@@ -173,8 +173,8 @@ blocksToBullets blks =
plainParaInlines :: Block -> [Inline]
plainParaInlines (Plain ils) = ils
-plainParaInlines (Para ils) = ils
-plainParaInlines _ = []
+plainParaInlines (Para ils) = ils
+plainParaInlines _ = []
blocksToDefinitions' :: [([Inline], [[Block]])] -> [Block] -> [Block] -> [Block]
blocksToDefinitions' [] acc [] = reverse acc
@@ -194,7 +194,7 @@ blocksToDefinitions' defAcc acc
| (not . null) defAcc && "Definition" `elem` classes2 =
let remainingAttr2 = (ident2, delete "Definition" classes2, kvs2)
defItems2 = case remainingAttr2 == ("", [], []) of
- True -> blks2
+ True -> blks2
False -> [Div remainingAttr2 blks2]
((defTerm, defItems):defs) = defAcc
defAcc' = case null defItems of
@@ -211,12 +211,12 @@ removeListDivs' :: Block -> [Block]
removeListDivs' (Div (ident, classes, kvs) blks)
| "list-item" `elem` classes =
case delete "list-item" classes of
- [] -> blks
+ [] -> blks
classes' -> [Div (ident, classes', kvs) $ blks]
removeListDivs' (Div (ident, classes, kvs) blks)
| not $ null $ listParagraphDivs `intersect` classes =
case classes \\ listParagraphDivs of
- [] -> blks
+ [] -> blks
classes' -> [Div (ident, classes', kvs) blks]
removeListDivs' blk = [blk]