Skip to content

Commit fcba4ec

Browse files
fix: handle only valid srcset tags (#253)
1 parent 9e5ce56 commit fcba4ec

File tree

2 files changed

+10
-9
lines changed

2 files changed

+10
-9
lines changed

README.md

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -53,18 +53,18 @@ You may need to specify loaders for images in your configuration (recommended `f
5353

5454
## Options
5555

56-
| Name | Type | Default | Description |
57-
| :-------------------------------: | :-----------------: | :---------------------------------------------------------------------------------------------------------------------------------: | :--------------------------------------- |
58-
| **[`attributes`](#attributes)** | `{Boolean\/Array}` | `[':srcset', 'img:src', 'audio:src', 'video:src', 'track:src', 'embed:src', 'source:src','input:src', 'object:data', 'script:src']` | Enables/Disables attributes handling |
59-
| **[`root`](#root)** | `{String}` | `undefiend` | Allow to handle root-relative attributes |
60-
| **[`interpolate`](#interpolate)** | `{Boolean}` | `false` | Allow to use expressions in HTML syntax |
61-
| **[`minimize`](#minimize)** | `{Boolean\|Object}` | `true` in production mode, otherwise `false` | Tell `html-loader` to minimize HTML |
62-
| **[`esModule`](#esmodule)** | `{Boolean}` | `false` | Use ES modules syntax |
56+
| Name | Type | Default | Description |
57+
| :-------------------------------: | :-----------------: | :-----------------------------------------------------------------------------------------------------------------------------------------------------: | :--------------------------------------- |
58+
| **[`attributes`](#attributes)** | `{Boolean\/Array}` | `['source:srcset', 'img:src', 'img:srcset', 'audio:src', 'video:src', 'track:src', 'embed:src', 'source:src','input:src', 'object:data', 'script:src']` | Enables/Disables attributes handling |
59+
| **[`root`](#root)** | `{String}` | `undefiend` | Allow to handle root-relative attributes |
60+
| **[`interpolate`](#interpolate)** | `{Boolean}` | `false` | Allow to use expressions in HTML syntax |
61+
| **[`minimize`](#minimize)** | `{Boolean\|Object}` | `true` in production mode, otherwise `false` | Tell `html-loader` to minimize HTML |
62+
| **[`esModule`](#esmodule)** | `{Boolean}` | `false` | Use ES modules syntax |
6363

6464
### `attributes`
6565

6666
Type: `Boolean|Array`
67-
Default: `[':srcset', 'img:src', 'audio:src', 'video:src', 'track:src', 'embed:src', 'source:src', 'input:src', 'object:data', 'script:src']`
67+
Default: `['source:srcset', 'img:src', 'img:srcset', 'audio:src', 'video:src', 'track:src', 'embed:src', 'source:src','input:src', 'object:data', 'script:src']`
6868

6969
#### `Boolean`
7070

src/plugins/source-plugin.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -378,8 +378,9 @@ export default (options) =>
378378
const tagsAndAttributes =
379379
typeof options.attributes === 'undefined' || options.attributes === true
380380
? [
381-
':srcset',
381+
'source:srcset',
382382
'img:src',
383+
'img:srcset',
383384
'audio:src',
384385
'video:src',
385386
'track:src',

0 commit comments

Comments
 (0)