aboutsummaryrefslogtreecommitdiff
path: root/src/mixins/postUtils.pug
diff options
context:
space:
mode:
Diffstat (limited to 'src/mixins/postUtils.pug')
-rw-r--r--src/mixins/postUtils.pug4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/mixins/postUtils.pug b/src/mixins/postUtils.pug
index 7eef9b2..d0e6400 100644
--- a/src/mixins/postUtils.pug
+++ b/src/mixins/postUtils.pug
@@ -60,7 +60,7 @@
60 // Find all anchors that href to preview.redd.it, i.redd.it, i.imgur.com 60 // Find all anchors that href to preview.redd.it, i.redd.it, i.imgur.com
61 // and contain just a link to the same href 61 // and contain just a link to the same href
62 const expression = /<a href="(http[s]?:\/\/(?:preview\.redd\.it|i\.redd\.it|i\.imgur\.com).*?)">\1?<\/a>/g; 62 const expression = /<a href="(http[s]?:\/\/(?:preview\.redd\.it|i\.redd\.it|i\.imgur\.com).*?)">\1?<\/a>/g;
63 const matches = html.matchAll(expression); 63 const matches = Array.from(html.matchAll(expression));
64 var result = html; 64 var result = html;
65 matches.forEach((match) => { 65 matches.forEach((match) => {
66 // Replace each occurrence with an actual img tag 66 // Replace each occurrence with an actual img tag
@@ -85,4 +85,4 @@
85 var poster_url = p.preview && p.preview.images ? p.preview.images[0].source.url.replace(expression, '&') : ''; 85 var poster_url = p.preview && p.preview.images ? p.preview.images[0].source.url.replace(expression, '&') : '';
86 86
87 return [hls_url, dash_url, fallback_url, scrubber_url, poster_url]; 87 return [hls_url, dash_url, fallback_url, scrubber_url, poster_url];
88 } \ No newline at end of file 88 }