Skip to content

Commit

Permalink
fix: correctly processing url with ?#hash (#803)
Browse files Browse the repository at this point in the history
  • Loading branch information
evilebottnawi committed Nov 26, 2018
1 parent fa50db7 commit 417d105
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion lib/loader.js
Expand Up @@ -132,7 +132,7 @@ module.exports = function loader(content, map) {
return `" + escape(require(${loaderUtils.stringifyRequest(
this,
urlRequest
)})) + "${url.substr(idx)}`;
)}) + "${url.substr(idx)}") + "`;
}
urlRequest = url;
return `" + escape(require(${loaderUtils.stringifyRequest(
Expand Down
4 changes: 2 additions & 2 deletions test/urlTest.js
Expand Up @@ -99,11 +99,11 @@ describe('url', () => {
);
test(
'font face',
"@font-face { src: url(regular.woff) format('woff'), url(~truetype/regular.ttf) format('truetype') }",
"@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'); }",
[
[
1,
"@font-face { src: url({./regular.woff}) format('woff'), url({truetype/regular.ttf}) format('truetype') }",
"@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'); }",
'',
],
]
Expand Down

0 comments on commit 417d105

Please sign in to comment.