git.iko.soy/typeable/pandoc
on master help sign in
Support underline in docx writer.

Updated golden test and confirmed validity of file. Closes #4633.

commit40603dd4cd80f633239d1f48da3c3c834412b02e authorJohn MacFarlane <jgm@berkeley.edu> dateTue 8 May 2018, 10:17 (8 years ago) parent780bf64
2 files changed+3
src/Text/Pandoc/Writers/Docx.hs+3 test/docx/golden/inline_formatting.docx
src/Text/Pandoc/Writers/Docx.hs+3
@@ -1111,6 +1111,9 @@ inlineToOpenXML' _ (Str str) =
11111111 formattedString str
11121112inlineToOpenXML' opts Space = inlineToOpenXML opts (Str " ")
11131113inlineToOpenXML' opts SoftBreak = inlineToOpenXML opts (Str " ")
1114+inlineToOpenXML' opts (Span (_,["underline"],_) ils) = do
1115+ withTextProp (mknode "w:u" [("w:val","single")] ()) $
1116+ inlinesToOpenXML opts ils
11141117inlineToOpenXML' _ (Span (ident,["comment-start"],kvs) ils) = do
11151118 -- prefer the "id" in kvs, since that is the one produced by the docx
11161119 -- reader.
test/docx/golden/inline_formatting.docx

Binary file not shown.