Skip to content

Commit

Permalink
Merge branch 'oppiliappan:master' into master
Browse files Browse the repository at this point in the history
  • Loading branch information
voc0der authored Jan 23, 2025
2 parents c0e63c1 + 342b9f1 commit 8758162
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions src/mixins/post.pug
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,9 @@ mixin post(p, currentUrl)
|  · 
| #{timeDifference(Date.now(), p.created * 1000)}
|  · 
a(href=`/r/${p.subreddit}?sort=${sortQuery}&view=${viewQuery}`) r/#{p.subreddit}
a(href=`/r/${p.subreddit}`) r/#{p.subreddit}
|  · 
a(href=`/comments/${p.id}?from=${from}&sort=${sortQuery}&view=${viewQuery}`) #{fmtnum (p.num_comments)}
a(href=`/comments/${p.id}?from=${from}`) #{fmtnum (p.num_comments)}
if (query.view == "card" && !isPostMedia(p) && p.selftext_html)
div.self-text-overflow.card
if p.spoiler || p.over_18
Expand Down
4 changes: 2 additions & 2 deletions src/mixins/postUtils.pug
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@
// Find all anchors that href to preview.redd.it, i.redd.it, i.imgur.com
// and contain just a link to the same href
const expression = /<a href="(http[s]?:\/\/(?:preview\.redd\.it|i\.redd\.it|i\.imgur\.com).*?)">\1?<\/a>/g;
const matches = html.matchAll(expression);
const matches = Array.from(html.matchAll(expression));
var result = html;
matches.forEach((match) => {
// Replace each occurrence with an actual img tag
Expand All @@ -85,4 +85,4 @@
var poster_url = p.preview && p.preview.images ? p.preview.images[0].source.url.replace(expression, '&') : '';
return [hls_url, dash_url, fallback_url, scrubber_url, poster_url];
}
}

0 comments on commit 8758162

Please sign in to comment.