From bca74a2bd0187c0dab522e768d7d18f8f53abfa9 Mon Sep 17 00:00:00 2001 From: Jesse Rosenthal Date: Mon, 11 Aug 2014 21:42:02 -0400 Subject: Add dropCap to paragraph style. --- src/Text/Pandoc/Readers/Docx/Parse.hs | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) (limited to 'src/Text') 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 -- cgit v1.2.3