mirror of
https://github.com/discourse/discourse.git
synced 2024-11-27 04:26:29 +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
|
@ -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…
Reference in New Issue
Block a user