···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
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);
64 var result = html;
65 matches.forEach((match) => {
66 // Replace each occurrence with an actual img tag
···85 var poster_url = p.preview && p.preview.images ? p.preview.images[0].source.url.replace(expression, '&') : '';
8687 return [hls_url, dash_url, fallback_url, scrubber_url, poster_url];
88- }
···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
62 const expression = /<a href="(http[s]?:\/\/(?:preview\.redd\.it|i\.redd\.it|i\.imgur\.com).*?)">\1?<\/a>/g;
63+ const matches = Array.from(html.matchAll(expression));
64 var result = html;
65 matches.forEach((match) => {
66 // Replace each occurrence with an actual img tag
···85 var poster_url = p.preview && p.preview.images ? p.preview.images[0].source.url.replace(expression, '&') : '';
8687 return [hls_url, dash_url, fallback_url, scrubber_url, poster_url];
88+ }