Preserve line-breaks on multiline HTML content
See original GitHub issuePrettier 1.15.2 Playground link
Input:
<html>
<body>
<div id="test">
aa
</div>
</body>
</html>
Output:
<html>
<body>
<div id="test">aa</div>
</body>
</html>
Expected behavior: Preserve line-break before and after “aa”.
<html>
<body>
<div id="test">
aa
</div>
</body>
</html>
This situation is similar to preserve multiline array notation of JavaScript.
Issue Analytics
- State:
- Created 5 years ago
- Reactions:5
- Comments:11 (5 by maintainers)
Top Results From Across the Web
Preserve line breaks in textarea - html - Stack Overflow
The line breaks the user entered are preserved, neither html nor php simply drops or alters anything. However html markup, when rendered for ......
Read more >How to Preserve Newlines, Line Breaks, and Whitespace in ...
Preserve Newlines, Line Breaks, and Whitespace in HTML. Use the white-space: pre; setting to display long-form content containing whitespace ...
Read more >The Dos and Don'ts of Adding an HTML Line Break
To do a line break in HTML, use the <br> tag. Simply place the tag wherever you want to force a line break....
Read more >PRESERVING LINE BREAK IN MULTI LINE TEXT BOX - MSDN
Lets say I have a multiline textbox and a user types a message in there. I want to save the message in the...
Read more >How to Preserve Line breaks while copying and past...
Hi All - I want to preserve the line breaks while copying and pasting the text from String field to HTML field.
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
When you say “required”, are you saying that the lack of newlines there breaks your app, or that you prefer the formatting with them?
You could use try overriding the
printWidth
for HTML files only @AndreasGassmann.