aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohn MacFarlane <jgm@berkeley.edu>2013-11-23 14:52:14 -0800
committerJohn MacFarlane <jgm@berkeley.edu>2013-11-23 14:52:14 -0800
commite1a9a61774cce807c6db2fff7b8609b2d9dbc678 (patch)
tree3ad17c28a355bd4300214caba5a77f53534060e9
parentb82ef0e29a652b7e1629b6e2e5f56140ed08e633 (diff)
downloadpandoc-e1a9a61774cce807c6db2fff7b8609b2d9dbc678.tar.gz
Docx writer: Implemented csl flipflopping spans.
-rw-r--r--src/Text/Pandoc/Writers/Docx.hs7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/Text/Pandoc/Writers/Docx.hs b/src/Text/Pandoc/Writers/Docx.hs
index b9c198a78..5c7341b69 100644
--- a/src/Text/Pandoc/Writers/Docx.hs
+++ b/src/Text/Pandoc/Writers/Docx.hs
@@ -638,7 +638,12 @@ formattedString str = do
inlineToOpenXML :: WriterOptions -> Inline -> WS [Element]
inlineToOpenXML _ (Str str) = formattedString str
inlineToOpenXML opts Space = inlineToOpenXML opts (Str " ")
-inlineToOpenXML opts (Span _ ils) = inlinesToOpenXML opts ils
+inlineToOpenXML opts (Span (_,classes,_) ils) = do
+ let off x = withTextProp (mknode x [("w:val","0")] ())
+ ((if "csl-no-emph" `elem` classes then off "w:i" else id) .
+ (if "csl-no-strong" `elem` classes then off "w:b" else id) .
+ (if "csl-no-smallcaps" `elem` classes then off "w:smallCaps" else id))
+ $ inlinesToOpenXML opts ils
inlineToOpenXML opts (Strong lst) =
withTextProp (mknode "w:b" [] ()) $ inlinesToOpenXML opts lst
inlineToOpenXML opts (Emph lst) =