git.iko.soy/typeable/pandoc
on master help sign in
Docx writer: Allow dynamic styles on spans.
d6b6055Jesse Rosenthal
src/Text/Pandoc/Writers/Docx.hs+5−1
@@ -1010,7 +1010,11 @@ inlineToOpenXML :: WriterOptions -> Inline -> WS [Element]
1010inlineToOpenXML _ (Str str) = formattedString str
1010inlineToOpenXML _ (Str str) = formattedString str
1011inlineToOpenXML opts Space = inlineToOpenXML opts (Str " ")
1011inlineToOpenXML opts Space = inlineToOpenXML opts (Str " ")
1012inlineToOpenXML opts SoftBreak = inlineToOpenXML opts (Str " ")
1012inlineToOpenXML opts SoftBreak = inlineToOpenXML opts (Str " ")
1013−inlineToOpenXML opts (Span (_,classes,kvs) ils)
1013+inlineToOpenXML opts (Span (ident,classes,kvs) ils)
1014+ | Just sty <- lookup dynamicStyleKey kvs = do
1015+ let kvs' = filter ((dynamicStyleKey, sty)/=) kvs
1016+ withTextProp (rCustomStyle sty) $
1017+ inlineToOpenXML opts (Span (ident,classes,kvs') ils)
1014 | "insertion" `elem` classes = do
1018 | "insertion" `elem` classes = do
1015 defaultAuthor <- gets stChangesAuthor
1019 defaultAuthor <- gets stChangesAuthor
1016 defaultDate <- gets stChangesDate
1020 defaultDate <- gets stChangesDate