From de1a76a2d53c450dddc7b26e297fc360de65d36d Mon Sep 17 00:00:00 2001 From: Florian Dieminger Date: Mon, 30 Sep 2024 10:37:04 +0200 Subject: [PATCH] fix(macros/jsxref): fix dot handling (#11869) fix(jsxref): fix dot handling Previously we replaces all single dots with a slash. This resulted in: {{jsxref("Operators/new%2Etarget", "new.target")}} An alternative is to change the logic to: If there is an slash in the 1st parameter don't replace the dots. This works for all en-US and the issue I found in translated content where alread broken. --- kumascript/macros/jsxref.ejs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/kumascript/macros/jsxref.ejs b/kumascript/macros/jsxref.ejs index 83ba7fbbca9e..cb88ad3d207b 100644 --- a/kumascript/macros/jsxref.ejs +++ b/kumascript/macros/jsxref.ejs @@ -29,8 +29,8 @@ const anchor = $2 || ''; const wrap = !$3; let slug = apiName.replace('()', '').replace('.prototype.', '.'); -if (apiName.includes(".") && !apiName.includes("..")) { - // E.g. "Array.filter", but not "try...catch". +if (apiName.includes(".") && !apiName.includes("/")) { + // E.g. "Array.filter", but not "Statements/try...catch". slug = slug.replace('.', '/'); }