@jsreport/jsreport-docx
Advanced tools
Comparing version 3.7.0 to 3.7.1
@@ -35,5 +35,16 @@ const { DOMParser, XMLSerializer } = require('@xmldom/xmldom') | ||
const xmlStr = new XMLSerializer().serializeToString(f.doc, undefined, (node) => { | ||
// we need to decode the xml entities for the attributes for handlebars to work ok | ||
if (node.nodeType === 2 && node.nodeValue && node.nodeValue.includes('{{')) { | ||
const str = new XMLSerializer().serializeToString(node) | ||
return decodeXML(str) | ||
} else if ( | ||
// we need to decode the xml entities in text nodes for handlebars to work ok with partials | ||
node.nodeType === 3 && node.nodeValue && | ||
(node.nodeValue.includes('{{>') || node.nodeValue.includes('{{#>')) | ||
) { | ||
const str = new XMLSerializer().serializeToString(node) | ||
return str.replace(/{{#?>/g, (m) => { | ||
return decodeXML(m) | ||
}) | ||
} | ||
@@ -40,0 +51,0 @@ |
{ | ||
"name": "@jsreport/jsreport-docx", | ||
"version": "3.7.0", | ||
"version": "3.7.1", | ||
"description": "jsreport recipe rendering docx files", | ||
@@ -54,3 +54,3 @@ "keywords": [ | ||
"@jsreport/jsreport-assets": "3.6.0", | ||
"@jsreport/jsreport-core": "3.11.0", | ||
"@jsreport/jsreport-core": "3.11.3", | ||
"@jsreport/jsreport-handlebars": "3.2.1", | ||
@@ -57,0 +57,0 @@ "@jsreport/studio-dev": "3.2.1", |
@@ -10,2 +10,6 @@ # @jsreport/jsreport-docx | ||
### 3.7.1 | ||
- fix docx rendering with handlebars partials | ||
### 3.7.0 | ||
@@ -12,0 +16,0 @@ |
338133
7957
61