Skip to content

Commit

Permalink
add attributes to selectors
Browse files Browse the repository at this point in the history
  • Loading branch information
janmonschke committed Dec 16, 2018
1 parent 6efd3c3 commit 067d453
Showing 1 changed file with 10 additions and 6 deletions.
16 changes: 10 additions & 6 deletions packages/gatsby-remark-copy-linked-files/src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -242,7 +242,7 @@ module.exports = (
}

// Handle Images
extractUrlAttributeAndElement($(`img`), `src`).forEach(
extractUrlAttributeAndElement($(`img[src]`), `src`).forEach(
({ url, element }) => {
try {
const ext = url.split(`.`).pop()
Expand All @@ -256,15 +256,19 @@ module.exports = (
)

// Handle video tags.
extractUrlAttributeAndElement($(`video source, video`), `src`).forEach(
processUrl
)
extractUrlAttributeAndElement(
$(`video source[src], video[src]`),
`src`
).forEach(processUrl)

// Handle audio tags.
extractUrlAttributeAndElement($(`audio source`), `src`).forEach(processUrl)
extractUrlAttributeAndElement(
$(`audio source[src], audio[src]`),
`src`
).forEach(processUrl)

// Handle a tags.
extractUrlAttributeAndElement($(`a`), `href`).forEach(processUrl)
extractUrlAttributeAndElement($(`a[href]`), `href`).forEach(processUrl)

return
})
Expand Down

0 comments on commit 067d453

Please sign in to comment.