Skip to content

Commit ee4b838

Browse files
test: invalid src (#231)
1 parent 85b09d9 commit ee4b838

File tree

7 files changed

+326
-30
lines changed

7 files changed

+326
-30
lines changed

src/index.js

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -36,11 +36,7 @@ export default function htmlLoader(source) {
3636
let offset = 0;
3737

3838
for (const link of links) {
39-
if (
40-
link.value &&
41-
isUrlRequest(link.value, options.root) &&
42-
!link.value.includes('mailto:')
43-
) {
39+
if (link.value && isUrlRequest(link.value, options.root)) {
4440
const uri = parse(link.value);
4541

4642
if (typeof uri.hash !== 'undefined') {

test/__snapshots__/attributes-option.test.js.snap

Lines changed: 160 additions & 10 deletions
Large diffs are not rendered by default.

test/__snapshots__/esModule-option.test.js.snap

Lines changed: 48 additions & 3 deletions
Large diffs are not rendered by default.

test/__snapshots__/loader.test.js.snap

Lines changed: 16 additions & 1 deletion
Large diffs are not rendered by default.

test/__snapshots__/minimize-option.test.js.snap

Lines changed: 54 additions & 9 deletions
Large diffs are not rendered by default.

test/__snapshots__/root-option.test.js.snap

Lines changed: 32 additions & 2 deletions
Large diffs are not rendered by default.

test/fixtures/simple.html

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -146,3 +146,18 @@ <h2>An Ordered HTML List</h2>
146146
&copy; 2007
147147
or
148148
&#169; 2007
149+
150+
<br>
151+
152+
<img src="data:image/png;base64, iVBORw0KGgoAAAANSUhEUgAAAAUAAAAFCAYAAACNbyblAAAAHElEQVQI12P4//8/w38GIAXDIBKE0DHxgljNBAAO9TXL0Y4OHwAAAABJRU5ErkJggg==" alt="Red dot" />
153+
<address>
154+
Written by <img src="mailto:webmaster@example.com">Jon Doe.<br>
155+
Visit us at:<br>
156+
Example.com<br>
157+
Box 564, Disneyland<br>
158+
USA
159+
</address>
160+
<img src="chrome://settings">link</img>
161+
<img src="skype:example123?chat">Start Chat</img>
162+
<img src="foobar:test">Start Chat</img>
163+
<img src="javascript:alert('Hello');">Start Chat</img>

0 commit comments

Comments
 (0)