-
-
Notifications
You must be signed in to change notification settings - Fork 529
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(format/html): opt out of formatting for
pre
, script
and `sty…
…le` tags (#4729)
- Loading branch information
Showing
7 changed files
with
99 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
13 changes: 13 additions & 0 deletions
13
crates/biome_html_formatter/tests/specs/html/elements/pre.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
<pre> | ||
___ ___ ___ ___ | ||
/\ \ ___ /\ \ /\__\ /\ \ | ||
/::\ \ /\ \ /::\ \ /::| | /::\ \ | ||
/:/\:\ \ \:\ \ /:/\:\ \ /:|:| | /:/\:\ \ | ||
/::\~\:\__\ /::\__\ /:/ \:\ \ /:/|:|__|__ /::\~\:\ \ | ||
/:/\:\ \:|__| __/:/\/__/ /:/__/ \:\__\ /:/ |::::\__\ /:/\:\ \:\__\ | ||
\:\~\:\/:/ / /\/:/ / \:\ \ /:/ / \/__/~~/:/ / \:\~\:\ \/__/ | ||
\:\ \::/ / \::/__/ \:\ /:/ / /:/ / \:\ \:\__\ | ||
\:\/:/ / \:\__\ \:\/:/ / /:/ / \:\ \/__/ | ||
\::/__/ \/__/ \::/ / /:/ / \:\__\ | ||
~~ \/__/ \/__/ \/__/ | ||
</pre> |
52 changes: 52 additions & 0 deletions
52
crates/biome_html_formatter/tests/specs/html/elements/pre.html.snap
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
--- | ||
source: crates/biome_formatter_test/src/snapshot_builder.rs | ||
info: elements/pre.html | ||
--- | ||
# Input | ||
|
||
```html | ||
<pre> | ||
___ ___ ___ ___ | ||
/\ \ ___ /\ \ /\__\ /\ \ | ||
/::\ \ /\ \ /::\ \ /::| | /::\ \ | ||
/:/\:\ \ \:\ \ /:/\:\ \ /:|:| | /:/\:\ \ | ||
/::\~\:\__\ /::\__\ /:/ \:\ \ /:/|:|__|__ /::\~\:\ \ | ||
/:/\:\ \:|__| __/:/\/__/ /:/__/ \:\__\ /:/ |::::\__\ /:/\:\ \:\__\ | ||
\:\~\:\/:/ / /\/:/ / \:\ \ /:/ / \/__/~~/:/ / \:\~\:\ \/__/ | ||
\:\ \::/ / \::/__/ \:\ /:/ / /:/ / \:\ \:\__\ | ||
\:\/:/ / \:\__\ \:\/:/ / /:/ / \:\ \/__/ | ||
\::/__/ \/__/ \::/ / /:/ / \:\__\ | ||
~~ \/__/ \/__/ \/__/ | ||
</pre> | ||
``` | ||
|
||
|
||
============================= | ||
|
||
# Outputs | ||
|
||
## Output 1 | ||
|
||
----- | ||
Indent style: Tab | ||
Indent width: 2 | ||
Line ending: LF | ||
Line width: 80 | ||
Attribute Position: Auto | ||
----- | ||
|
||
```html | ||
<pre>___ ___ ___ ___ | ||
/\ \ ___ /\ \ /\__\ /\ \ | ||
/::\ \ /\ \ /::\ \ /::| | /::\ \ | ||
/:/\:\ \ \:\ \ /:/\:\ \ /:|:| | /:/\:\ \ | ||
/::\~\:\__\ /::\__\ /:/ \:\ \ /:/|:|__|__ /::\~\:\ \ | ||
/:/\:\ \:|__| __/:/\/__/ /:/__/ \:\__\ /:/ |::::\__\ /:/\:\ \:\__\ | ||
\:\~\:\/:/ / /\/:/ / \:\ \ /:/ / \/__/~~/:/ / \:\~\:\ \/__/ | ||
\:\ \::/ / \::/__/ \:\ /:/ / /:/ / \:\ \:\__\ | ||
\:\/:/ / \:\__\ \:\/:/ / /:/ / \:\ \/__/ | ||
\::/__/ \/__/ \::/ / /:/ / \:\__\ | ||
~~ \/__/ \/__/ \/__/ | ||
</pre> | ||
``` |