-
Notifications
You must be signed in to change notification settings - Fork 142
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
Line breaks are missing in LibreOffice Writer #68
Comments
I'm afraid this library only targets MS Word. Sorry about that! |
(in case anyone read this before, I've edited it to update with a better technique) I found a workaround that seems to work in LibreOffice and FreeOffice TextMaker: const literalXmlDelimiter = "||";
const preserveWhitespace = string =>
string
.split(/[\n\r]+/) // could use different split criteria here
.map(
para =>
`${literalXmlDelimiter}</w:t><w:br/>${literalXmlDelimiter}${para}${literalXmlDelimiter}<w:t>${literalXmlDelimiter}`
)
.join(""); In other words, make sure to terminate the preceding If anyone else finds this helpful, I can make a PR... lmk! |
Contagious06
added a commit
to Contagious06/docx-templates
that referenced
this issue
Oct 22, 2020
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hello,
Line breaks are missing in LibreOffice Writer (v6.1.6.3, Ubuntu) but show up in online viewer (for example https://onlinedocumentviewer.com).
Steps to reproduce:
docx-templates/packages/docx-templates/src/__tests__/indexNode.test.js
Line 465 in 4c007ad
Expected result:
According to test template, there should be two line breaks starting with words 'Nullam' and 'Morbi'.
Actual:
Line breaks are missing.
The text was updated successfully, but these errors were encountered: