Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
fix: linefeed characters in sources (#311)
  • Loading branch information
evilebottnawi committed Aug 18, 2020
1 parent c247cfa commit b8ee9ee
Show file tree
Hide file tree
Showing 6 changed files with 416 additions and 44 deletions.
2 changes: 1 addition & 1 deletion src/utils.js
Expand Up @@ -371,7 +371,7 @@ export function parseSrc(input) {
}

export function normalizeUrl(url) {
return decodeURIComponent(url);
return decodeURIComponent(url).replace(/[\t\n\r]/g, '');
}

export function requestify(url, root) {
Expand Down
250 changes: 228 additions & 22 deletions test/__snapshots__/attributes-option.test.js.snap

Large diffs are not rendered by default.

66 changes: 60 additions & 6 deletions test/__snapshots__/esModule-option.test.js.snap

Large diffs are not rendered by default.

22 changes: 20 additions & 2 deletions test/__snapshots__/loader.test.js.snap

Large diffs are not rendered by default.

97 changes: 85 additions & 12 deletions test/__snapshots__/minimize-option.test.js.snap

Large diffs are not rendered by default.

23 changes: 22 additions & 1 deletion test/fixtures/simple.html
Expand Up @@ -319,4 +319,25 @@ <h2>An Ordered HTML List</h2>

<button onclick=" document.getElementById('demo').innerHTML = Date()">The time is?</button>

<img src="!!url-loader!./pixel.png" alt="" />
<img src="!!url-loader!./pixel.png" alt="" />

<img src="
!!url-loader!./pixel.png
" alt="" />

<img src="./im
age.png" alt="multi
line
alt" />

<img src="data:image/png;base64,iVBORw0KGgoAAA
ANSUhEUgAAAAUAAAAFCAYAAACNbyblAAAAHElEQVQI12P4
//8/w38GIAXDIBKE0DHxgljNBAAO9TXL0Y4OHwAAAABJRU
5ErkJggg==" alt="Red dot" />

0 comments on commit b8ee9ee

Please sign in to comment.