Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix linefeed characters in url #311

Merged
merged 5 commits into from Aug 18, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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" />