@tryghost/mg-substack 0.8.4 → 0.8.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/lib/process.js +11 -2
  2. package/package.json +5 -5
package/lib/process.js CHANGED
@@ -146,6 +146,10 @@ const processContent = (post, siteUrl, options) => {
146
146
  $(el).remove();
147
147
  });
148
148
 
149
+ $html('div.poll-embed').each((i, el) => {
150
+ $(el).remove();
151
+ });
152
+
149
153
  $html('.image3').each((i, el) => {
150
154
  const attrs = $(el).attr('data-attrs');
151
155
  const attrsObj = JSON.parse(attrs);
@@ -636,7 +640,7 @@ const processContent = (post, siteUrl, options) => {
636
640
 
637
641
  // Replace any signup forms with a Portal signup button
638
642
  if (options.subscribeLink) {
639
- $html('.subscription-widget-wrap').each((i, div) => {
643
+ $html('.subscription-widget-wrap, .subscription-widget-wrap-editor').each((i, div) => {
640
644
  const hasForm = $(div).find('form');
641
645
 
642
646
  if (hasForm.length) {
@@ -693,7 +697,12 @@ const processContent = (post, siteUrl, options) => {
693
697
  let $script = $('<script async="" src="//www.instagram.com/embed.js"></script>');
694
698
  let $figure = $('<figure class="instagram"></figure>');
695
699
 
696
- $iframe.attr('src', `${src}embed/captioned/`);
700
+ // Trim the trailing slash from src if it exists
701
+ if (src.endsWith('/')) {
702
+ src = src.slice(0, -1);
703
+ }
704
+
705
+ $iframe.attr('src', `${src}/embed/captioned/`);
697
706
  $figure.append($iframe);
698
707
  $figure.append($script);
699
708
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tryghost/mg-substack",
3
- "version": "0.8.4",
3
+ "version": "0.8.6",
4
4
  "repository": "https://github.com/TryGhost/migrate/tree/main/packages/mg-substack",
5
5
  "author": "Ghost Foundation",
6
6
  "license": "MIT",
@@ -27,15 +27,15 @@
27
27
  "dependencies": {
28
28
  "@tryghost/debug": "0.1.35",
29
29
  "@tryghost/errors": "1.3.8",
30
- "@tryghost/kg-default-cards": "10.1.5",
31
- "@tryghost/mg-fs-utils": "0.16.1",
30
+ "@tryghost/kg-default-cards": "10.2.0",
31
+ "@tryghost/mg-fs-utils": "0.16.2",
32
32
  "@tryghost/string": "0.2.17",
33
33
  "cheerio": "1.0.0-rc.12",
34
34
  "he": "1.2.0",
35
35
  "html-entities": "2.6.0",
36
36
  "lodash": "4.17.21",
37
37
  "simple-dom": "1.4.0",
38
- "srcset": "5.0.1"
38
+ "srcset": "5.0.2"
39
39
  },
40
- "gitHead": "2cc65b7a0a9a9c14a5088382da8c0a75f58d8df3"
40
+ "gitHead": "93b72e5f4374d9f097876b71e78fdc920af364ff"
41
41
  }