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:
David Taylor 2018-12-05 18:29:54 +00:00
parent a1d9aeda8b
commit 8aff99761a

View File

@ -104,6 +104,11 @@ export default class PostCooked {
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)
if (valid && isValidLink($link)) {
const title = I18n.t("topic_map.clicks", { count: lc.clicks });