-
Notifications
You must be signed in to change notification settings - Fork 146
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
New line character inside a variable does not work #143
Comments
As I couldn't reproduce this problem, i'll close this issue for now. Feel free to reopen if it persists. Please make sure you're running a fully updated version of MS Word (or equivalent) and are using the latest version of the library. |
I am also seeing this same issue.
Word for Mac version 16.41 |
I have tried with v4.0.0 and v4.5.0, same result. |
…dunn. Couldn't reproduce issue as test. See #143 (comment)
That is super weird. I get the below result when running a test case based on your example (see 153afe7). The resulting Word file seems correct... Maybe its because i'm using MS Word for Mac 16.16.26 instead of 16.41 or something, or maybe our runtime envs are different. Which compiler toolchain / runtime environment are you using? (i.e. angular, webpack, browserify, which version, etc.). I'll flag this as a bug for now because even if the issue is caused by something outside of the library we'll probably want to prevent it somehow. |
Really weird, today this is no longer happening and line breaks are coming through as expected. No change to package, Node or Word versions. Same test case as above. Genuinely no idea what happened — but I can't recreate it! For reference I'm using this in Node directly (v12.14.1). Same result (working) both writing to a file and returning via a buffer from an Express endpoint ( I think maybe this can be closed again and I'll re-open if I hit the issue again and can narrow it down further. Sorry to have potentially raised a false alarm. |
Hmmm super strange. No i dont think it was a false alarm. I get the same view as you when opening in Google drive. To me it seems like some viewers interpret the linebreak differently or not at all... I'll keep it open for a while so i can study it some more when i find the time. |
AFAIK our implementation is up to 'spec' on this front (http://officeopenxml.com/WPtextSpecialContent-break.php), and I can't imagine there's some non-determinism at play in this library... My working theory is that it is caused by heterogeneity in the MS Word reader landscape. MS Word (versions?), google drive, etc. aren't created equal, regretfully... @nickdunn if you find a new example, please let me know. Thanks for your report! |
@jjhbw i replaced <w:br/> with </w:t></w:r><w:r><w:br/><w:t xml:space="preserve"> in processTempalte and it works correct in LibreOffice and Ms office 2007, but breaks next line formatting With <w:br/> correct work only in ms office 2007. |
I faced the same issue. LibreOffice completely ignored line breaks and Google drive lost some of the text.
With settings: |
As a complement, I noticed that (edit:) The referenced issue proposes to fix the bug like this:
|
the same issue here. New lines don't work. |
Fix for this issue is mentioned in #68 |
Sadly it still doesn't work in LibreOffice 7.1.5.2 (Arch Linux) with latest [email protected], nodejs v16.5.0. LibreOffice's wrapper unoconv is widely used to convert docx to PDF automatically in docker containers and API wrapers like gotenberg. |
…dunn. Does not work in LibreOffice. See #143 (comment)
…dunn. Does not work in LibreOffice. See #143 (comment)
…lt (i.e. processLineBreaksAsNewText is now always set to true).
I have merged #182 into I can't push a new release to NPM now, because @guigrpa and I are working out some NPM permissions issues. Pulling the latest master commit into your package.json from GitHub is an alternative until the release is pushed. |
…lt (i.e. processLineBreaksAsNewText is now always set to true).
Hello,
I'm trying to replace a variable that contains newline character
\n
.But this line break is not rendered in the output file, it's just ignored.
address.docx
Expected output
Actual output
I even tried to specify
processLineBreaks: true
(though it should be a default value) but without any change.Thanks for help!
The text was updated successfully, but these errors were encountered: