Skip to content

Commit ef173e2

Browse files
jbeuckmpieh
authored andcommitted
feat(gatsby-remark-copy-linked-files): handle flash object tags (#14381)
1 parent 585a9d3 commit ef173e2

File tree

2 files changed

+17
-0
lines changed

2 files changed

+17
-0
lines changed

packages/gatsby-remark-copy-linked-files/src/__tests__/index.js

+12
Original file line numberDiff line numberDiff line change
@@ -210,6 +210,18 @@ describe(`gatsby-remark-copy-linked-files`, () => {
210210
expect(fsExtra.copy).toHaveBeenCalled()
211211
})
212212

213+
it(`can copy flash from object elements with the value attribute`, async () => {
214+
const path = `myMovie.swf`
215+
216+
const markdownAST = remark.parse(
217+
`<object type="application/x-shockwave-flash">\n<param name="movie" value="${path}" />\n</object>`
218+
)
219+
220+
await plugin({ files: getFiles(path), markdownAST, markdownNode, getNode })
221+
222+
expect(fsExtra.copy).toHaveBeenCalled()
223+
})
224+
213225
it(`can copy HTML videos when some siblings are in ignore extensions`, async () => {
214226
const path = `videos/sample-video.mp4`
215227
const path1 = `images/sample-image.jpg`

packages/gatsby-remark-copy-linked-files/src/index.js

+5
Original file line numberDiff line numberDiff line change
@@ -267,6 +267,11 @@ module.exports = (
267267
`src`
268268
).forEach(processUrl)
269269

270+
// Handle flash embed tags.
271+
extractUrlAttributeAndElement($(`object param[value]`), `value`).forEach(
272+
processUrl
273+
)
274+
270275
// Handle a tags.
271276
extractUrlAttributeAndElement($(`a[href]`), `href`).forEach(processUrl)
272277

0 commit comments

Comments
 (0)