preserveBlankLines does not work.
See original GitHub issuevar ast = esprima.parse(code, {
loc: true,
range: true,
comment: true,
tokens: true
});
gen.attachComments(ast, ast.comments, ast.tokens);
var output = gen.generate(ast, {
format: {
compact: false,
preserveBlankLines: true
},
comment: true,
sourceMap: 'script.js',
sourceMapWithCode: true
});
Disappointingly, blank line is removed from code.
Issue Analytics
- State:
- Created 8 years ago
- Comments:9
Top Results From Across the Web
using for /f to preserve blank lines - TechNet - Microsoft
I use the command below, which works but it doesn't save the empty lines. What do I need to add to preserve the...
Read more >Why is it so hard to preserve blank lines? - MobileRead Forums
The purists will insist you use margins to create a blank line and although they are correct, your reading program need to honor...
Read more >Ghostscript textwriter preserve blank lines - pdf - Stack Overflow
Typically, a PDF has no blank lines. Even the notion of a 'line' is fairly broad - the specifications allow for a sequence...
Read more >ChangeLog - mandoc
This fixes a wide range of formatting issues: * Print named escapes inside ... "Exp", lines: +68 -26 Preserve blank lines inside literal...
Read more >Getting Started - djLint
--quiet Do not print diff when reformatting. ... --preserve-blank-lines Attempt to preserve blank lines. ... Running with a path -
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
any additional info on this, would be nice to preserve newlines and seems like a simple feature that doesn’t work?
The way I preserved blank lines was like this:
This mostly works. I noticed today that sometimes a newline is omitted.