Skip to content

Commit

Permalink
fix: handle only valid srcset tags (#253)
Browse files Browse the repository at this point in the history
  • Loading branch information
evilebottnawi committed Mar 12, 2020
1 parent 9e5ce56 commit fcba4ec
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 9 deletions.
16 changes: 8 additions & 8 deletions README.md
Expand Up @@ -53,18 +53,18 @@ You may need to specify loaders for images in your configuration (recommended `f

## Options

| Name | Type | Default | Description |
| :-------------------------------: | :-----------------: | :---------------------------------------------------------------------------------------------------------------------------------: | :--------------------------------------- |
| **[`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 |
| **[`root`](#root)** | `{String}` | `undefiend` | Allow to handle root-relative attributes |
| **[`interpolate`](#interpolate)** | `{Boolean}` | `false` | Allow to use expressions in HTML syntax |
| **[`minimize`](#minimize)** | `{Boolean\|Object}` | `true` in production mode, otherwise `false` | Tell `html-loader` to minimize HTML |
| **[`esModule`](#esmodule)** | `{Boolean}` | `false` | Use ES modules syntax |
| Name | Type | Default | Description |
| :-------------------------------: | :-----------------: | :-----------------------------------------------------------------------------------------------------------------------------------------------------: | :--------------------------------------- |
| **[`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 |
| **[`root`](#root)** | `{String}` | `undefiend` | Allow to handle root-relative attributes |
| **[`interpolate`](#interpolate)** | `{Boolean}` | `false` | Allow to use expressions in HTML syntax |
| **[`minimize`](#minimize)** | `{Boolean\|Object}` | `true` in production mode, otherwise `false` | Tell `html-loader` to minimize HTML |
| **[`esModule`](#esmodule)** | `{Boolean}` | `false` | Use ES modules syntax |

### `attributes`

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

#### `Boolean`

Expand Down
3 changes: 2 additions & 1 deletion src/plugins/source-plugin.js
Expand Up @@ -378,8 +378,9 @@ export default (options) =>
const tagsAndAttributes =
typeof options.attributes === 'undefined' || options.attributes === true
? [
':srcset',
'source:srcset',
'img:src',
'img:srcset',
'audio:src',
'video:src',
'track:src',
Expand Down

0 comments on commit fcba4ec

Please sign in to comment.