git.iko.soy/typeable/pandoc
on master help sign in
Docx Writer: Keep track of dynamic text props too.
commit66d393ae7ad4199333ef1e61c0c012c169bea093 authorJesse Rosenthal <jrosenthal@jhu.edu> dateMon 15 Aug 2016, 12:41 (10 years ago) parentd6b6055
1 file changed+3
src/Text/Pandoc/Writers/Docx.hs+3
src/Text/Pandoc/Writers/Docx.hs+3
@@ -111,6 +111,7 @@ data WriterState = WriterState{
111111 , stFirstPara :: Bool
112112 , stTocTitle :: [Inline]
113113 , stDynamicParaProps :: [String]
114+ , stDynamicTextProps :: [String]
114115 }
115116
116117defaultWriterState :: WriterState
@@ -134,6 +135,7 @@ defaultWriterState = WriterState{
134135 , stFirstPara = False
135136 , stTocTitle = normalizeInlines [Str "Table of Contents"]
136137 , stDynamicParaProps = []
138+ , stDynamicTextProps = []
137139 }
138140
139141type WS a = StateT WriterState IO a
@@ -1013,6 +1015,7 @@ inlineToOpenXML opts SoftBreak = inlineToOpenXML opts (Str " ")
10131015inlineToOpenXML opts (Span (ident,classes,kvs) ils)
10141016 | Just sty <- lookup dynamicStyleKey kvs = do
10151017 let kvs' = filter ((dynamicStyleKey, sty)/=) kvs
1018+ modify $ \s -> s{stDynamicTextProps = sty : (stDynamicTextProps s)}
10161019 withTextProp (rCustomStyle sty) $
10171020 inlineToOpenXML opts (Span (ident,classes,kvs') ils)
10181021 | "insertion" `elem` classes = do