git.iko.soy/typeable/pandoc
on master help sign in
Docx Writer: Keep track of dynamic text props too.
66d393aJesse Rosenthal
src/Text/Pandoc/Writers/Docx.hs+3
@@ -111,6 +111,7 @@ data WriterState = WriterState{
111 , stFirstPara :: Bool
111 , stFirstPara :: Bool
112 , stTocTitle :: [Inline]
112 , stTocTitle :: [Inline]
113 , stDynamicParaProps :: [String]
113 , stDynamicParaProps :: [String]
114+ , stDynamicTextProps :: [String]
114 }
115 }
115
116
116defaultWriterState :: WriterState
117defaultWriterState :: WriterState
@@ -134,6 +135,7 @@ defaultWriterState = WriterState{
134 , stFirstPara = False
135 , stFirstPara = False
135 , stTocTitle = normalizeInlines [Str "Table of Contents"]
136 , stTocTitle = normalizeInlines [Str "Table of Contents"]
136 , stDynamicParaProps = []
137 , stDynamicParaProps = []
138+ , stDynamicTextProps = []
137 }
139 }
138
140
139type WS a = StateT WriterState IO a
141type WS a = StateT WriterState IO a
@@ -1013,6 +1015,7 @@ inlineToOpenXML opts SoftBreak = inlineToOpenXML opts (Str " ")
1013inlineToOpenXML opts (Span (ident,classes,kvs) ils)
1015inlineToOpenXML opts (Span (ident,classes,kvs) ils)
1014 | Just sty <- lookup dynamicStyleKey kvs = do
1016 | Just sty <- lookup dynamicStyleKey kvs = do
1015 let kvs' = filter ((dynamicStyleKey, sty)/=) kvs
1017 let kvs' = filter ((dynamicStyleKey, sty)/=) kvs
1018+ modify $ \s -> s{stDynamicTextProps = sty : (stDynamicTextProps s)}
1016 withTextProp (rCustomStyle sty) $
1019 withTextProp (rCustomStyle sty) $
1017 inlineToOpenXML opts (Span (ident,classes,kvs') ils)
1020 inlineToOpenXML opts (Span (ident,classes,kvs') ils)
1018 | "insertion" `elem` classes = do
1021 | "insertion" `elem` classes = do