Skip to content

Commit

Permalink
fix(jsxref): fix dot handling
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
fiji-flo committed Sep 26, 2024
1 parent c5ccaf1 commit 001f854
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions kumascript/macros/jsxref.ejs
Original file line number Diff line number Diff line change
Expand Up @@ -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('.', '/');
}
Expand Down

0 comments on commit 001f854

Please sign in to comment.