Skip to content

Commit

Permalink
Second reproduction case for #143 based on template supplied by @nick…
Browse files Browse the repository at this point in the history
…dunn. Does not work in LibreOffice. See #143 (comment)
  • Loading branch information
jjhbw committed Feb 23, 2023
1 parent bd28ebf commit 2de3e68
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 0 deletions.
Binary file not shown.
15 changes: 15 additions & 0 deletions src/__tests__/templating.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1223,6 +1223,21 @@ Morbi dignissim consequat ex, non finibus est faucibus sodales. Integer sed just
};
expect(await createReport(opts, 'XML')).toMatchSnapshot();
});

it('newline character inside variable issue #143', async () => {
const template = await fs.promises.readFile(
path.join(__dirname, 'fixtures', 'newlineInVariableIssue143.docx')
);
const headline = 'I am a line\n\nAnd so am I!';
const result = await createReport({
template,
data: {
headline: headline,
},
});
expect(result).toBeInstanceOf(Uint8Array);
await fs.promises.writeFile('test.docx', result);
});
});
});
});

0 comments on commit 2de3e68

Please sign in to comment.