Skip to content

Commit

Permalink
fix: Rspack cssParser will parse failed when url(' ') (#8824)
Browse files Browse the repository at this point in the history
fix: parsing process for handling strings with multiple spaces

Co-authored-by: bobihuang <[email protected]>
  • Loading branch information
cbbfcd and bobihuang authored Dec 24, 2024
1 parent c99e882 commit 7607a4e
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 1 deletion.
2 changes: 1 addition & 1 deletion crates/rspack_plugin_css/src/parser_and_generator/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,7 @@ impl ParserAndGenerator for CssParserAndGenerator {
range,
kind,
} => {
if request.is_empty() {
if request.trim().is_empty() {
continue;
}
let request = replace_module_request_prefix(
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
```css title=main.css
body {
background: red url(' ');
}


```
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
import "./style.css";
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
body {
background: red url(' ');
}

0 comments on commit 7607a4e

Please sign in to comment.