aboutsummaryrefslogtreecommitdiff
path: root/src/Text
diff options
context:
space:
mode:
authorJesse Rosenthal <jrosenthal@jhu.edu>2014-08-11 21:42:02 -0400
committerJesse Rosenthal <jrosenthal@jhu.edu>2014-08-11 21:42:02 -0400
commitbca74a2bd0187c0dab522e768d7d18f8f53abfa9 (patch)
tree76c9c5cf987390c71f2696c545f674cacf21a120 /src/Text
parent86d4da994a2e8a091aea325d9738f3b99ab4dbca (diff)
downloadpandoc-bca74a2bd0187c0dab522e768d7d18f8f53abfa9.tar.gz
Add dropCap to paragraph style.
Diffstat (limited to 'src/Text')
-rw-r--r--src/Text/Pandoc/Readers/Docx/Parse.hs14
1 files changed, 12 insertions, 2 deletions
diff --git a/src/Text/Pandoc/Readers/Docx/Parse.hs b/src/Text/Pandoc/Readers/Docx/Parse.hs
index 1abd4bc6b..175bf2784 100644
--- a/src/Text/Pandoc/Readers/Docx/Parse.hs
+++ b/src/Text/Pandoc/Readers/Docx/Parse.hs
@@ -146,12 +146,14 @@ data ParIndentation = ParIndentation { leftParIndent :: Maybe Integer
data ParagraphStyle = ParagraphStyle { pStyle :: [String]
, indentation :: Maybe ParIndentation
+ , dropCap :: Bool
}
deriving Show
defaultParagraphStyle :: ParagraphStyle
defaultParagraphStyle = ParagraphStyle { pStyle = []
, indentation = Nothing
+ , dropCap = False
}
@@ -637,8 +639,16 @@ elemToParagraphStyle ns element
(findAttr (elemName ns "w" "val"))
(findChildren (elemName ns "w" "pStyle") pPr)
, indentation =
- findChild (elemName ns "w" "ind") pPr >>=
- elemToParIndentation ns
+ findChild (elemName ns "w" "ind") pPr >>=
+ elemToParIndentation ns
+ , dropCap =
+ case
+ findChild (elemName ns "w" "framePr") pPr >>=
+ findAttr (elemName ns "w" "dropCap")
+ of
+ Just "none" -> False
+ Just _ -> True
+ Nothing -> False
}
elemToParagraphStyle _ _ = defaultParagraphStyle