Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
Prev Previous commit
Next Next commit
Check for newline too
  • Loading branch information
thecrypticace committed Jan 28, 2025
commit fba346e19924012492cd12970d4f5aa0beaabc4e
7 changes: 6 additions & 1 deletion crates/oxide/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -449,7 +449,12 @@ fn read_changed_content(c: ChangedContent) -> Option<Vec<u8>> {
match extension {
// Angular class shorthand
Some("html") => Some(content.replace("[class.", "[")),
Some("svelte") => Some(content.replace(" class:", " ").replace("\tclass:", " ")),
Some("svelte") => Some(
content
.replace(" class:", " ")
.replace("\tclass:", " ")
.replace("\nclass:", " "),
),
_ => Some(content),
}
}
Expand Down
2 changes: 2 additions & 0 deletions crates/oxide/tests/scanner.rs
Original file line number Diff line number Diff line change
Expand Up @@ -332,6 +332,7 @@ mod scanner {
("index.svelte", "<div class:px-4='condition'></div>"),
("index2.svelte", "<div\n\tclass:px-5='condition'></div>"),
("index3.svelte", "<div\n class:px-6='condition'></div>"),
("index4.svelte", "<div\nclass:px-7='condition'></div>"),
])
.1;

Expand All @@ -346,6 +347,7 @@ mod scanner {
"px-4",
"px-5",
"px-6",
"px-7",
"underline"
]
);
Expand Down