File tree Expand file tree Collapse file tree 3 files changed +23
-6
lines changed Expand file tree Collapse file tree 3 files changed +23
-6
lines changed Original file line number Diff line number Diff line change 12
12
"@newrelic/gatsby-theme-newrelic" : " ^1.32.1" ,
13
13
"@splitsoftware/splitio-react" : " ^1.2.0" ,
14
14
"babel-jest" : " ^26.3.0" ,
15
+ "common-tags" : " ^1.8.0" ,
15
16
"date-fns" : " ^2.16.1" ,
16
17
"front-matter" : " ^4.0.2" ,
17
18
"gatsby" : " ^2.32.0" ,
26
27
"gatsby-remark-autolink-headers" : " ^2.7.0" ,
27
28
"gatsby-remark-copy-linked-files" : " ^2.6.0" ,
28
29
"gatsby-remark-images" : " ^3.11.0" ,
30
+ "gatsby-remark-responsive-iframe" : " ^2.11.0" ,
29
31
"gatsby-source-filesystem" : " ^2.7.0" ,
30
32
"gatsby-transformer-json" : " ^2.9.0" ,
31
33
"gatsby-transformer-remark" : " ^2.12.0" ,
Original file line number Diff line number Diff line change 1
1
const visit = require ( 'unist-util-visit' ) ;
2
2
const { parse } = require ( 'node-html-parser' ) ;
3
+ const { oneLine } = require ( 'common-tags' ) ;
3
4
4
5
module . exports = ( { markdownAST } ) => {
5
6
visit ( markdownAST , 'html' , ( node ) => {
@@ -13,14 +14,17 @@ module.exports = ({ markdownAST }) => {
13
14
const src = element . getAttribute ( 'src' ) ;
14
15
const title = element . getAttribute ( 'title' ) ;
15
16
16
- node . value = `
17
- <div class="wistia_responsive_wrapper" style="padding: 56.25% 0 0 0; position: relative; height: 0;">
18
- <iframe allow="accelerometer; autoplay; encrypted-media; gyroscope; picture-in-picture" allowfullscreen src="${ src } " title="${
17
+ const rawHTML = oneLine `
18
+ <div class="wistia_responsive_wrapper" style="padding: 56.25% 0 0 0; position: relative; height: 0;"><iframe allow="accelerometer; autoplay; encrypted-media; gyroscope; picture-in-picture" allowfullscreen src="${ src } " title="${
19
19
title || ''
20
- } " class="wistia_embed" frameborder="0" style="position: absolute; top: 0; left: 0; height: 100%; width: 100%;" />
21
- </div>
20
+ } " class="wistia_embed" scrolling="no" frameborder="0" style="position: absolute; top: 0; left: 0; height: 100%; width: 100%;"></iframe></div>
22
21
` . trim ( ) ;
23
- console . log ( node ) ;
22
+
23
+ node . data = {
24
+ hChildren : [ { type : `raw` , value : rawHTML } ] ,
25
+ } ;
26
+ node . type = `unknown` ;
27
+ delete node . value ;
24
28
} ) ;
25
29
26
30
return markdownAST ;
Original file line number Diff line number Diff line change @@ -8652,6 +8652,17 @@ gatsby-remark-images@^3.11.0:
8652
8652
unist-util-select "^1.5.0"
8653
8653
unist-util-visit-parents "^2.1.2"
8654
8654
8655
+ gatsby-remark-responsive-iframe@^2.11.0:
8656
+ version "2.11.0"
8657
+ resolved "https://registry.yarnpkg.com/gatsby-remark-responsive-iframe/-/gatsby-remark-responsive-iframe-2.11.0.tgz#c5b68f06324138a31f85fdb5da5503ab812b5446"
8658
+ integrity sha512-qqrYfUb4+9VhndBeEaKrhiyyKIReAK4BHL3/8ZCtFDem5ZQQd5pUdgYhExRLcoGxzwJrqVxI6+dtT/RoXLqC/g==
8659
+ dependencies:
8660
+ "@babel/runtime" "^7.12.5"
8661
+ cheerio "^1.0.0-rc.3"
8662
+ common-tags "^1.8.0"
8663
+ lodash "^4.17.20"
8664
+ unist-util-visit "^1.4.1"
8665
+
8655
8666
gatsby-source-filesystem@^2.3.19:
8656
8667
version "2.3.24"
8657
8668
resolved "https://registry.yarnpkg.com/gatsby-source-filesystem/-/gatsby-source-filesystem-2.3.24.tgz#857932fb91cba876ff1e48172103ead66cf2b0fe"
You can’t perform that action at this time.
0 commit comments