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>
This commit is contained in:
Edwin Török
2023-12-18 17:15:03 -08:00
committed by John MacFarlane
parent c5780857e5
commit 95dde29c5e
4 changed files with 2 additions and 2 deletions
+2 -2
View File
@@ -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")] ()) $
Binary file not shown.
Binary file not shown.
Binary file not shown.