diff options
author | John MacFarlane <jgm@berkeley.edu> | 2013-11-23 14:52:14 -0800 |
---|---|---|
committer | John MacFarlane <jgm@berkeley.edu> | 2013-11-23 14:52:14 -0800 |
commit | e1a9a61774cce807c6db2fff7b8609b2d9dbc678 (patch) | |
tree | 3ad17c28a355bd4300214caba5a77f53534060e9 | |
parent | b82ef0e29a652b7e1629b6e2e5f56140ed08e633 (diff) | |
download | pandoc-e1a9a61774cce807c6db2fff7b8609b2d9dbc678.tar.gz |
Docx writer: Implemented csl flipflopping spans.
-rw-r--r-- | src/Text/Pandoc/Writers/Docx.hs | 7 |
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) = |