aboutsummaryrefslogtreecommitdiff
path: root/src/Text
diff options
context:
space:
mode:
authorJesse Rosenthal <jrosenthal@jhu.edu>2016-08-15 12:35:11 -0400
committerJesse Rosenthal <jrosenthal@jhu.edu>2016-08-15 12:35:11 -0400
commitd6b60558e3d6e4e1f0aace48b37c904915561657 (patch)
treea9d97917d7934194a5001e2eb9ac8fbb73fcc97e /src/Text
parent59bc1e68aa5786284729c3dafc94d7e3dc924141 (diff)
downloadpandoc-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.hs6
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