diff options
author | Jesse Rosenthal <jrosenthal@jhu.edu> | 2016-08-15 12:35:11 -0400 |
---|---|---|
committer | Jesse Rosenthal <jrosenthal@jhu.edu> | 2016-08-15 12:35:11 -0400 |
commit | d6b60558e3d6e4e1f0aace48b37c904915561657 (patch) | |
tree | a9d97917d7934194a5001e2eb9ac8fbb73fcc97e /src/Text | |
parent | 59bc1e68aa5786284729c3dafc94d7e3dc924141 (diff) | |
download | pandoc-d6b60558e3d6e4e1f0aace48b37c904915561657.tar.gz |
Docx writer: Allow dynamic styles on spans.
This enables dynamic styling on spans. It uses the same prefix as we
used on divs ("docx-style" for the moment). It does not yet inject the
style into styles.xml.
Diffstat (limited to 'src/Text')
-rw-r--r-- | src/Text/Pandoc/Writers/Docx.hs | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/src/Text/Pandoc/Writers/Docx.hs b/src/Text/Pandoc/Writers/Docx.hs index 82f8bfcac..51cdbb621 100644 --- a/src/Text/Pandoc/Writers/Docx.hs +++ b/src/Text/Pandoc/Writers/Docx.hs @@ -1010,7 +1010,11 @@ inlineToOpenXML :: WriterOptions -> Inline -> WS [Element] inlineToOpenXML _ (Str str) = formattedString str inlineToOpenXML opts Space = inlineToOpenXML opts (Str " ") inlineToOpenXML opts SoftBreak = inlineToOpenXML opts (Str " ") -inlineToOpenXML opts (Span (_,classes,kvs) ils) +inlineToOpenXML opts (Span (ident,classes,kvs) ils) + | Just sty <- lookup dynamicStyleKey kvs = do + let kvs' = filter ((dynamicStyleKey, sty)/=) kvs + withTextProp (rCustomStyle sty) $ + inlineToOpenXML opts (Span (ident,classes,kvs') ils) | "insertion" `elem` classes = do defaultAuthor <- gets stChangesAuthor defaultDate <- gets stChangesDate |