@tryghost/mg-tinynews 0.10.0 → 0.10.1
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.
- package/lib/json-to-html.js +14 -10
- package/package.json +2 -2
package/lib/json-to-html.js
CHANGED
|
@@ -252,25 +252,29 @@ const jsonToHtml = (blocks) => {
|
|
|
252
252
|
} else if (itemType === 'image') {
|
|
253
253
|
html.push(EntryImage(block));
|
|
254
254
|
} else if (itemType === 'embed') {
|
|
255
|
-
|
|
255
|
+
const embedUrl = URL.parse(block.link);
|
|
256
|
+
const embedHost = embedUrl?.hostname ?? '';
|
|
257
|
+
const embedPath = embedUrl?.pathname ?? '';
|
|
258
|
+
|
|
259
|
+
if (embedHost === 'twitter.com') {
|
|
256
260
|
html.push(EntryTwitterEmbed(block));
|
|
257
|
-
} else if (
|
|
261
|
+
} else if (embedHost === 'www.tiktok.com') {
|
|
258
262
|
html.push(EntryTikTokEmbed(block));
|
|
259
|
-
} else if (
|
|
263
|
+
} else if (embedHost === 'www.facebook.com') {
|
|
260
264
|
html.push(EntryFacebookEmbed(block));
|
|
261
|
-
} else if (
|
|
265
|
+
} else if (embedHost === 'vimeo.com') {
|
|
262
266
|
html.push(EntryVimeoEmbed(block));
|
|
263
|
-
} else if (
|
|
267
|
+
} else if (embedHost === 'www.youtube.com' || embedHost === 'youtu.be') {
|
|
264
268
|
html.push(EntryYoutubeEmbed(block));
|
|
265
|
-
} else if (
|
|
269
|
+
} else if (embedHost === 'podcasts.apple.com') {
|
|
266
270
|
html.push(EntryApplePodcastsEmbed(block));
|
|
267
|
-
} else if (
|
|
271
|
+
} else if (embedHost === 'open.spotify.com' && (embedPath.startsWith('/episode/') || embedPath.startsWith('/show/'))) {
|
|
268
272
|
html.push(EntrySpotifyEmbed(block));
|
|
269
|
-
} else if (
|
|
273
|
+
} else if (embedHost === 'www.instagram.com' && embedPath.startsWith('/p/')) {
|
|
270
274
|
html.push(EntryInstagramPostEmbed(block));
|
|
271
|
-
} else if (
|
|
275
|
+
} else if (embedHost === 'www.instagram.com' && embedPath.startsWith('/reel/')) {
|
|
272
276
|
html.push(EntryInstagramReelEmbed(block));
|
|
273
|
-
} else if (
|
|
277
|
+
} else if (embedHost === 'docs.google.com') {
|
|
274
278
|
html.push(EntryGoogleDocsEmbed(block));
|
|
275
279
|
} else {
|
|
276
280
|
// eslint-disable-next-line no-console
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tryghost/mg-tinynews",
|
|
3
|
-
"version": "0.10.
|
|
3
|
+
"version": "0.10.1",
|
|
4
4
|
"repository": {
|
|
5
5
|
"type": "git",
|
|
6
6
|
"url": "git+https://github.com/TryGhost/migrate.git",
|
|
@@ -25,7 +25,7 @@
|
|
|
25
25
|
"@tryghost/string": "0.3.5",
|
|
26
26
|
"sanitize-html": "2.17.5",
|
|
27
27
|
"simple-dom": "1.4.0",
|
|
28
|
-
"@tryghost/mg-utils": "0.11.
|
|
28
|
+
"@tryghost/mg-utils": "0.11.1"
|
|
29
29
|
},
|
|
30
30
|
"scripts": {
|
|
31
31
|
"dev": "echo \"Implement me!\"",
|