Skip to content
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

feat(formatter/html): add line break at the end of files #4010

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions crates/biome_html_formatter/src/html/auxiliary/root.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
use crate::prelude::*;
use biome_formatter::write;
use biome_html_syntax::HtmlRoot;
#[derive(Debug, Clone, Default)]
pub(crate) struct FormatHtmlRoot;
Expand All @@ -16,6 +17,7 @@ impl FormatNodeRule<HtmlRoot> for FormatHtmlRoot {
if let Ok(eof) = node.eof_token() {
eof.format().fmt(f)?;
}
write!(f, [hard_line_break()])?;

Ok(())
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,4 +30,5 @@ Attribute Position: Auto
disabled
class="w-full h-full bg-green text-white"
id="foo"
></div>```
></div>
```
Original file line number Diff line number Diff line change
Expand Up @@ -25,4 +25,5 @@ Attribute Position: Auto
-----

```html
<div foo="bar" id="foo"></div>```
<div foo="bar" id="foo"></div>
```
Original file line number Diff line number Diff line change
Expand Up @@ -25,4 +25,5 @@ Attribute Position: Auto
-----

```html
<meta charset="utf-8" />```
<meta charset="utf-8" />
```
Original file line number Diff line number Diff line change
Expand Up @@ -25,4 +25,5 @@ Attribute Position: Auto
-----

```html
<img src="foo.png'" alt='should keep "these" quotes' />```
<img src="foo.png'" alt='should keep "these" quotes' />
```
Original file line number Diff line number Diff line change
Expand Up @@ -36,4 +36,5 @@ Attribute Position: Auto
ornare ipsum. Class aptent taciti sociosqu ad litora torquent per conubia
nostra, per inceptos himenaeos. Ut nec dapibus est. Maecenas orci purus,
blandit eu faucibus eu, lacinia id turpis.
</div>```
</div>
```
Original file line number Diff line number Diff line change
Expand Up @@ -37,4 +37,5 @@ Attribute Position: Auto
<div>Quuz</div>
<div>Corge</div>
<div>Grault</div>
</div>```
</div>
```
Original file line number Diff line number Diff line change
Expand Up @@ -30,4 +30,5 @@ Attribute Position: Auto
<div>
<br />
<img />
</div>```
</div>
```
Loading