Describe the bug
Special XML characters in "the context" can result in corrupted DOCX output.
To Reproduce
docx example would contain
{%p for defect in defects %}
Criticality: {{ defect.criticality }}
Source: {{ defect.source }}
{%p endfor %}
The context in json format
{
"defects": [
{
"criticality": "<select>",
"source": "QA"
},
{
"criticality": "Safety Related",
"source": "QA"
}
]
}
No error is given during the template generation, but the .docx is corrupt. You can still open the .docx, but
the contents looks like this:
Expected behavior
The generated .docx should be like this:
Safety Criticality: <select>
Source: QA
Safety Criticality: Safety Related
Source: QA