Skip to content

Commit 342b9f1

Browse files
committed
minor fixes
- avoid extra sort & view options on /comments - avoid extra sort & view options on /r/sub in post card
1 parent 71280f0 commit 342b9f1

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

src/mixins/post.pug

+2-2
Original file line numberDiff line numberDiff line change
@@ -25,9 +25,9 @@ mixin post(p, currentUrl)
2525
|  · 
2626
| #{timeDifference(Date.now(), p.created * 1000)}
2727
|  · 
28-
a(href=`/r/${p.subreddit}?sort=${sortQuery}&view=${viewQuery}`) r/#{p.subreddit}
28+
a(href=`/r/${p.subreddit}`) r/#{p.subreddit}
2929
|  · 
30-
a(href=`/comments/${p.id}?from=${from}&sort=${sortQuery}&view=${viewQuery}`) #{fmtnum (p.num_comments)}
30+
a(href=`/comments/${p.id}?from=${from}`) #{fmtnum (p.num_comments)}
3131
if (query.view == "card" && !isPostMedia(p) && p.selftext_html)
3232
div.self-text-overflow.card
3333
if p.spoiler || p.over_18

src/mixins/postUtils.pug

+2-2
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@
6060
// Find all anchors that href to preview.redd.it, i.redd.it, i.imgur.com
6161
// and contain just a link to the same href
6262
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));
6464
var result = html;
6565
matches.forEach((match) => {
6666
// Replace each occurrence with an actual img tag
@@ -85,4 +85,4 @@
8585
var poster_url = p.preview && p.preview.images ? p.preview.images[0].source.url.replace(expression, '&') : '';
8686
8787
return [hls_url, dash_url, fallback_url, scrubber_url, poster_url];
88-
}
88+
}

0 commit comments

Comments
 (0)