v18.0.1 Rebasing SCSS url() breaks when there are more than two quote characters due to concatenation #27739
Closed
1 task done
Labels
angular/build:application
area: @angular/build
freq1: low
Only reported by a handful of users who observe it rarely
severity5: regression
type: bug/fix
Command
build
Is this a regression?
The previous version in which this bug was not present was
17.3.8
Description
When the URL of an SCSS asset is made up of multiple concatenated strings, the lexer yields the (partial) URL after it encounters the second quote character, even though the URL might not be done, as
+ "other/string"
follows. (https://github.com/angular/angular-cli/blob/main/packages/angular/build/src/tools/sass/lexer.ts#L95)This can break URLs, in my case by adding extraneous whitespace:
url("#{$icons-path}functional/fonts/#{$icon-font-family+ "-" + $icon-category}.woff2")
↓
lexer yields part between the first two
"
, note the trailing whitespace:#{$icons-path}functional/fonts/#{$icon-font-family+
↓
rebase, this escapes whitespace:
"base||file:#{$icons-path}functional/fonts/#{$icon-font-family+\\ "
↓
"base||file:#{$icons-path}functional/fonts/#{$icon-font-family+\\ "-" + $icon-category}.woff2"
↓
base||file:@pkg/dir/functional/fonts/solid-24\\ -zoom.woff2
Minimal Reproduction
Exception or Error
Your Environment
Anything else relevant?
No response
The text was updated successfully, but these errors were encountered: