diff options
author | John MacFarlane <jgm@berkeley.edu> | 2020-12-03 09:51:23 -0800 |
---|---|---|
committer | John MacFarlane <jgm@berkeley.edu> | 2020-12-03 09:51:23 -0800 |
commit | 5bbd5a9e80c4f4356d71b54315cf75b5ae2f3650 (patch) | |
tree | d368924a12a6422c975ef2b6c6de53b2f08920fd | |
parent | aab54c43258e53e4c1fde1b574c65ff8769709d0 (diff) | |
download | pandoc-5bbd5a9e80c4f4356d71b54315cf75b5ae2f3650.tar.gz |
Docx writer: Support bold and italic in "complex script."
Previously bold and italics didn't work properly in LTR
text. This commit causes the w:bCs and w:iCs attributes
to be used, in addition to w:b and w:i, for bold and
italics respectively.
Closes #6911.
-rw-r--r-- | src/Text/Pandoc/Writers/Docx.hs | 8 | ||||
-rw-r--r-- | test/docx/golden/custom_style_preserve.docx | bin | 10573 -> 10578 bytes | |||
-rw-r--r-- | test/docx/golden/definition_list.docx | bin | 9844 -> 9850 bytes | |||
-rw-r--r-- | test/docx/golden/inline_formatting.docx | bin | 9959 -> 9969 bytes |
4 files changed, 6 insertions, 2 deletions
diff --git a/src/Text/Pandoc/Writers/Docx.hs b/src/Text/Pandoc/Writers/Docx.hs index a380fd4fa..4cb879e6a 100644 --- a/src/Text/Pandoc/Writers/Docx.hs +++ b/src/Text/Pandoc/Writers/Docx.hs @@ -1272,9 +1272,13 @@ inlineToOpenXML' opts (Span (ident,classes,kvs) ils) = do $ inlinesToOpenXML opts ils wrapBookmark ident contents inlineToOpenXML' opts (Strong lst) = - withTextProp (mknode "w:b" [] ()) $ inlinesToOpenXML opts lst + withTextProp (mknode "w:b" [] ()) $ + withTextProp (mknode "w:bCs" [] ()) $ -- needed for LTR, #6911 + inlinesToOpenXML opts lst inlineToOpenXML' opts (Emph lst) = - withTextProp (mknode "w:i" [] ()) $ inlinesToOpenXML opts lst + withTextProp (mknode "w:i" [] ()) $ + withTextProp (mknode "w:iCs" [] ()) $ -- needed for LTR, #6911 + inlinesToOpenXML opts lst inlineToOpenXML' opts (Underline lst) = withTextProp (mknode "w:u" [("w:val","single")] ()) $ inlinesToOpenXML opts lst diff --git a/test/docx/golden/custom_style_preserve.docx b/test/docx/golden/custom_style_preserve.docx Binary files differindex ac595cdd4..17804bb81 100644 --- a/test/docx/golden/custom_style_preserve.docx +++ b/test/docx/golden/custom_style_preserve.docx diff --git a/test/docx/golden/definition_list.docx b/test/docx/golden/definition_list.docx Binary files differindex 005f5dbe3..21629e208 100644 --- a/test/docx/golden/definition_list.docx +++ b/test/docx/golden/definition_list.docx diff --git a/test/docx/golden/inline_formatting.docx b/test/docx/golden/inline_formatting.docx Binary files differindex ce1d16daa..e12e3b38d 100644 --- a/test/docx/golden/inline_formatting.docx +++ b/test/docx/golden/inline_formatting.docx |