Skip to content

Commit 417d105

Browse files
authoredNov 26, 2018
fix: correctly processing url with ?#hash (#803)
1 parent fa50db7 commit 417d105

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed
 

Diff for: ‎lib/loader.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,7 @@ module.exports = function loader(content, map) {
132132
return `" + escape(require(${loaderUtils.stringifyRequest(
133133
this,
134134
urlRequest
135-
)})) + "${url.substr(idx)}`;
135+
)}) + "${url.substr(idx)}") + "`;
136136
}
137137
urlRequest = url;
138138
return `" + escape(require(${loaderUtils.stringifyRequest(

Diff for: ‎test/urlTest.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -99,11 +99,11 @@ describe('url', () => {
9999
);
100100
test(
101101
'font face',
102-
"@font-face { src: url(regular.woff) format('woff'), url(~truetype/regular.ttf) format('truetype') }",
102+
"@font-face { src: url(regular.woff) format('woff'), url(~truetype/regular.ttf) format('truetype'), url('Mark Simonson - Proxima Nova Alt Regular-webfont.eot?#iefix') format('embedded-opentype'), url('webfont.svg#svgFontName') format('svg'), url('webfont.woff2?foo=bar') format('woff2'); }",
103103
[
104104
[
105105
1,
106-
"@font-face { src: url({./regular.woff}) format('woff'), url({truetype/regular.ttf}) format('truetype') }",
106+
"@font-face { src: url({./regular.woff}) format('woff'), url({truetype/regular.ttf}) format('truetype'), url(\"{./Mark Simonson - Proxima Nova Alt Regular-webfont.eot}?#iefix\") format('embedded-opentype'), url({./webfont.svg}#svgFontName) format('svg'), url({./webfont.woff2?foo=bar}) format('woff2'); }",
107107
'',
108108
],
109109
]

0 commit comments

Comments
 (0)
Please sign in to comment.