Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

OOXMLValidator: issues with ordering of strong vs emph #9273

Closed
edwintorok opened this issue Dec 19, 2023 · 1 comment
Closed

OOXMLValidator: issues with ordering of strong vs emph #9273

edwintorok opened this issue Dec 19, 2023 · 1 comment
Labels

Comments

@edwintorok
Copy link
Contributor

Explain the problem.
This seems to be now the only remaining validation error:

which dotnet || ("dotnet is required" && exit 1)
/usr/bin/dotnet
which json_reformat || ("json_reformat is required" && exit 1)
/usr/bin/json_reformat
test -d ./OOXML-Validator || \
        (git clone https://github.com/mikeebowen/OOXML-Validator.git \
        && cd OOXML-Validator && dotnet build --configuration=Release)
dotnet run --no-build --no-restore --project OOXML-Validator/OOXMLValidatorCLI -- test/docx/golden -r | json_reformat
[
    {
        "FilePath": "test/docx/golden/inline_formatting.docx",
        "ValidationErrors": "[{\"Description\":\"The element has unexpected child element 'http://schemas.openxmlformats.org/wordprocessingml/2006/main:b'.\",\"Path\":{\"NamespacesDefinitions\":[\"xmlns:w=\\\"http://schemas.openxmlformats.org/wordprocessingml/2006/main\\\"\"],\"Namespaces\":{},\"XPath\":\"/w:document[1]/w:body[1]/w:p[1]/w:r[7]/w:rPr[1]\",\"PartUri\":\"/word/document.xml\"},\"Id\":\"Sch_UnexpectedElementContentExpectingComplex\",\"ErrorType\":\"Schema\"}]"
    }
]

As the comment in the code explains though (Combine.hs) the order can be either Strong(Emph(..)), or Emph(Strong(..)),
so this might need to be sorted when flattened.

Pandoc version?
Latest main + my PR

@edwintorok
Copy link
Contributor Author

BTW this is really minor, everything else seems to be fine now wrt to validation after the linked PR.

edwintorok added a commit to edwintorok/pandoc that referenced this issue Dec 19, 2023
Fixes jgm#9273

```
[
    {
        "Description": "The element has unexpected child element 'http://schemas.openxmlformats.org/wordprocessingml/2006/main:b'.",
        "Path": {
            "NamespacesDefinitions": [
                "xmlns:w=\"http://schemas.openxmlformats.org/wordprocessingml/2006/main\""
            ],
            "Namespaces": {

            },
            "XPath": "/w:document[1]/w:body[1]/w:p[1]/w:r[7]/w:rPr[1]",
            "PartUri": "/word/document.xml"
        },
        "Id": "Sch_UnexpectedElementContentExpectingComplex",
        "ErrorType": "Schema"
    }
]
```

Signed-off-by: Edwin Török <edwin@etorok.net>
@jgm jgm closed this as completed in 712d746 Dec 19, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant