mirror of
https://github.com/discourse/discourse.git
synced 2025-09-07 12:02:53 +08:00
FIX: Ignore query parameters when displaying counter on internal links
This matches the server-side behaviour, so that the links display counters correctly
This commit is contained in:
parent
a1d9aeda8b
commit
8aff99761a
1 changed files with 5 additions and 0 deletions
|
@ -104,6 +104,11 @@ export default class PostCooked {
|
||||||
valid = href.indexOf(lc.url) >= 0;
|
valid = href.indexOf(lc.url) >= 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Match server-side behaviour for internal links with query params
|
||||||
|
if (lc.internal && /\?/.test(href)) {
|
||||||
|
valid = href.split("?")[0] === lc.url;
|
||||||
|
}
|
||||||
|
|
||||||
// don't display badge counts on category badge & oneboxes (unless when explicitely stated)
|
// don't display badge counts on category badge & oneboxes (unless when explicitely stated)
|
||||||
if (valid && isValidLink($link)) {
|
if (valid && isValidLink($link)) {
|
||||||
const title = I18n.t("topic_map.clicks", { count: lc.clicks });
|
const title = I18n.t("topic_map.clicks", { count: lc.clicks });
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue