diff options
Diffstat (limited to 'src/mixins/postUtils.pug')
-rw-r--r-- | src/mixins/postUtils.pug | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/mixins/postUtils.pug b/src/mixins/postUtils.pug index 84add09..b778cbd 100644 --- a/src/mixins/postUtils.pug +++ b/src/mixins/postUtils.pug | |||
@@ -53,8 +53,9 @@ | |||
53 | } | 53 | } |
54 | - | 54 | - |
55 | function convertInlineImageLinks(html) { | 55 | function convertInlineImageLinks(html) { |
56 | // Find all anchors that href to https://preview.redd.it | 56 | // Find all anchors that href to preview.redd.it, i.redd.it, i.imgur.com |
57 | const expression = /<a href="https:\/\/preview\.redd\.it.*?">(.*?)<\/a>/g; | 57 | // and contain just a link to the same href |
58 | const expression = /<a href="(http[s]?:\/\/(?:preview\.redd\.it|i\.redd\.it|i\.imgur\.com).*?)">\1?<\/a>/g; | ||
58 | const matches = html.matchAll(expression); | 59 | const matches = html.matchAll(expression); |
59 | var result = html; | 60 | var result = html; |
60 | matches.forEach((match) => { | 61 | matches.forEach((match) => { |