Closed Robilol closed 5 years ago
Hello,
I have some comments in my XLIFF files and i got an error with the function cause of them.
node_modules/xliff/xliff12ToJs.js:49 const key = transUnit.attributes.id; TypeError: Cannot read property 'id' of undefined
Indeed the function try to get the ID on a comment type element :
console.log(transUnit) ... { type: 'element', name: 'trans-unit', attributes: { id: 'seo_anchor_city' }, elements: [ { type: 'element', name: 'source', elements: [Array] }, { type: 'element', name: 'target', elements: [Array] } ] } { type: 'comment', comment: ' comment ' }
I think you should probably add a check to get the ID attribute only on element type and ignore comment type
fixed with v4.3.1
Hello,
I have some comments in my XLIFF files and i got an error with the function cause of them.
Indeed the function try to get the ID on a comment type element :
I think you should probably add a check to get the ID attribute only on element type and ignore comment type