git.iko.soy/typeable/pandoc
on master help sign in
Add dropCap to paragraph style.
bca74a2Jesse Rosenthal
src/Text/Pandoc/Readers/Docx/Parse.hs+12−2
@@ -146,12 +146,14 @@ data ParIndentation = ParIndentation { leftParIndent :: Maybe Integer
146
146
147data ParagraphStyle = ParagraphStyle { pStyle :: [String]
147data ParagraphStyle = ParagraphStyle { pStyle :: [String]
148 , indentation :: Maybe ParIndentation
148 , indentation :: Maybe ParIndentation
149+ , dropCap :: Bool
149 }
150 }
150 deriving Show
151 deriving Show
151
152
152defaultParagraphStyle :: ParagraphStyle
153defaultParagraphStyle :: ParagraphStyle
153defaultParagraphStyle = ParagraphStyle { pStyle = []
154defaultParagraphStyle = ParagraphStyle { pStyle = []
154 , indentation = Nothing
155 , indentation = Nothing
156+ , dropCap = False
155 }
157 }
156
158
157
159
@@ -637,8 +639,16 @@ elemToParagraphStyle ns element
637 (findAttr (elemName ns "w" "val"))
639 (findAttr (elemName ns "w" "val"))
638 (findChildren (elemName ns "w" "pStyle") pPr)
640 (findChildren (elemName ns "w" "pStyle") pPr)
639 , indentation =
641 , indentation =
640− findChild (elemName ns "w" "ind") pPr >>=
642+ findChild (elemName ns "w" "ind") pPr >>=
641− elemToParIndentation ns
643+ elemToParIndentation ns
644+ , dropCap =
645+ case
646+ findChild (elemName ns "w" "framePr") pPr >>=
647+ findAttr (elemName ns "w" "dropCap")
648+ of
649+ Just "none" -> False
650+ Just _ -> True
651+ Nothing -> False
642 }
652 }
643elemToParagraphStyle _ _ = defaultParagraphStyle
653elemToParagraphStyle _ _ = defaultParagraphStyle
644
654