From b904a79544765ac4b5fa3731837e2e7ea67a3916 Mon Sep 17 00:00:00 2001 From: Florian Dieminger Date: Mon, 22 Apr 2024 18:26:17 +0200 Subject: [PATCH] fix(macro): fix duplicate entries in APIRef fixes #10864 --- kumascript/macros/APIRef.ejs | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/kumascript/macros/APIRef.ejs b/kumascript/macros/APIRef.ejs index 7c568af65348..a00bfa2c5378 100644 --- a/kumascript/macros/APIRef.ejs +++ b/kumascript/macros/APIRef.ejs @@ -175,7 +175,7 @@ async function buildSublist(pages, title) { const title = getPageTitle(aPage); result += '
  • '; - + const pageBadges = (await page.badges(aPage)).join(""); if (rtlLocales.indexOf(locale) != -1) { @@ -205,8 +205,10 @@ function buildIFList(interfaces, title) { var result = '
  • ' + title + '
      '; for (var i = 0; i < interfaces.length; i++) { - var url = interfaces[i].replace('()', '').replace('.', '/'); - result += `
    1. ${web.smartLink(APIHref + '/' + url, null, `${interfaces[i]}`, APIHref, null, "APIRef")}
    2. `; + var url = APIHref + '/' + interfaces[i].replace('()', '').replace('.', '/'); + if (!url.endsWith(slug)) { + result += `
    3. ${web.smartLink(url, null, `${interfaces[i]}`, APIHref, null, "APIRef")}
    4. `; + } } result += '
  • ';