git.iko.soy/typeable/pandoc
on master help sign in
Docx writer: Implemented csl flipflopping spans.
commite1a9a61774cce807c6db2fff7b8609b2d9dbc678 authorJohn MacFarlane <jgm@berkeley.edu> dateSat 23 Nov 2013, 14:52 (13 years ago) parentb82ef0e
1 file changed+6−1
src/Text/Pandoc/Writers/Docx.hs+6−1
src/Text/Pandoc/Writers/Docx.hs+6−1
@@ -638,7 +638,12 @@ formattedString str = do
638638inlineToOpenXML :: WriterOptions -> Inline -> WS [Element]
639639inlineToOpenXML _ (Str str) = formattedString str
640640inlineToOpenXML opts Space = inlineToOpenXML opts (Str " ")
641−inlineToOpenXML opts (Span _ ils) = inlinesToOpenXML opts ils
641+inlineToOpenXML opts (Span (_,classes,_) ils) = do
642+ let off x = withTextProp (mknode x [("w:val","0")] ())
643+ ((if "csl-no-emph" `elem` classes then off "w:i" else id) .
644+ (if "csl-no-strong" `elem` classes then off "w:b" else id) .
645+ (if "csl-no-smallcaps" `elem` classes then off "w:smallCaps" else id))
646+ $ inlinesToOpenXML opts ils
642647inlineToOpenXML opts (Strong lst) =
643648 withTextProp (mknode "w:b" [] ()) $ inlinesToOpenXML opts lst
644649inlineToOpenXML opts (Emph lst) =