aboutsummaryrefslogtreecommitdiff
path: root/src/Text/Pandoc/Readers/Docx/Parse.hs
diff options
context:
space:
mode:
authorJohn MacFarlane <jgm@berkeley.edu>2014-08-11 20:38:23 -0700
committerJohn MacFarlane <jgm@berkeley.edu>2014-08-11 20:38:23 -0700
commit4c88e64894af56a71a15289a70b2ae7950157f86 (patch)
tree4a9f2b07c691c2af7ffa119c56b1ec8478b0c4f4 /src/Text/Pandoc/Readers/Docx/Parse.hs
parent86d4da994a2e8a091aea325d9738f3b99ab4dbca (diff)
parent45ec035e93ec0c32f9fb7d7f2f99ca17de73ebf9 (diff)
downloadpandoc-4c88e64894af56a71a15289a70b2ae7950157f86.tar.gz
Merge pull request #1522 from jkr/dropCap
Drop cap
Diffstat (limited to 'src/Text/Pandoc/Readers/Docx/Parse.hs')
-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