diff options
| author | Edwin Török <edwin@etorok.net> | 2023-12-18 23:43:57 +0000 |
|---|---|---|
| committer | John MacFarlane <jgm@berkeley.edu> | 2023-12-18 17:15:03 -0800 |
| commit | 95dde29c5e19addaf8098c64a056e5056a4c4334 (patch) | |
| tree | f1fd85b1fe5c3572915b5843f968ffdb642b479e | |
| parent | c5780857e5ebe54246d3066e7aa95424309bd05c (diff) | |
fix(docx): fix validation error on inline w:i/w:iCs order
From `make validate-docx-golden-tests2`:
```
{
"FilePath": "test/docx/golden/definition_list.docx",
"ValidationErrors": "[{\"Description\":\"The element has unexpected child element 'http://schemas.openxmlformats.org/wordprocessingml/2006/main:i'.\",\"Path\":{\"NamespacesDefinitions\":[\"xmlns:w=\\\"http://schemas.openxmlformats.org/wordprocessingml/2006/main\\\"\"],\"Namespaces\":{},\"XPath\":\"/w:document[1]/w:body[1]/w:p[3]/w:r[3]/w:rPr[1]\",\"PartUri\":\"/word/document.xml\"},\"Id\":\"Sch_UnexpectedElementContentExpectingComplex\",\"ErrorType\":\"Schema\"}]"
},
```
Signed-off-by: Edwin Török <edwin@etorok.net>
| -rw-r--r-- | src/Text/Pandoc/Writers/Docx.hs | 4 | ||||
| -rw-r--r-- | test/docx/golden/custom_style_preserve.docx | bin | 10532 -> 10532 bytes | |||
| -rw-r--r-- | test/docx/golden/definition_list.docx | bin | 9801 -> 9800 bytes | |||
| -rw-r--r-- | test/docx/golden/inline_formatting.docx | bin | 9920 -> 9918 bytes |
4 files changed, 2 insertions, 2 deletions
diff --git a/src/Text/Pandoc/Writers/Docx.hs b/src/Text/Pandoc/Writers/Docx.hs index 7db854187..3acd695c5 100644 --- a/src/Text/Pandoc/Writers/Docx.hs +++ b/src/Text/Pandoc/Writers/Docx.hs @@ -1364,12 +1364,12 @@ inlineToOpenXML' opts (Span (ident,classes,kvs) ils) = do langmod $ inlinesToOpenXML opts ils wrapBookmark ident contents inlineToOpenXML' opts (Strong lst) = - withTextProp (mknode "w:b" [] ()) $ withTextProp (mknode "w:bCs" [] ()) $ -- needed for LTR, #6911 + withTextProp (mknode "w:b" [] ()) $ inlinesToOpenXML opts lst inlineToOpenXML' opts (Emph lst) = - withTextProp (mknode "w:i" [] ()) $ withTextProp (mknode "w:iCs" [] ()) $ -- needed for LTR, #6911 + withTextProp (mknode "w:i" [] ()) $ inlinesToOpenXML opts lst inlineToOpenXML' opts (Underline lst) = withTextProp (mknode "w:u" [("w:val","single")] ()) $ diff --git a/test/docx/golden/custom_style_preserve.docx b/test/docx/golden/custom_style_preserve.docx Binary files differindex 1a23653ad..f0e876431 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 2a2a1b374..2ed32448f 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 008828954..f08344cda 100644 --- a/test/docx/golden/inline_formatting.docx +++ b/test/docx/golden/inline_formatting.docx |
