From b93ab6bde8d3ba19196becf10c1b82d0177f8a4a Mon Sep 17 00:00:00 2001 From: Aviv Keller Date: Mon, 16 Feb 2026 17:33:41 -0500 Subject: [PATCH 1/3] fix(slugger): optimize trailing/leading regex --- src/utils/parser/constants.mjs | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/utils/parser/constants.mjs b/src/utils/parser/constants.mjs index 9f79c0b7..e10903b3 100644 --- a/src/utils/parser/constants.mjs +++ b/src/utils/parser/constants.mjs @@ -6,8 +6,7 @@ export const DOC_API_SLUGS_REPLACEMENTS = [ { from: /&/, to: '-and-' }, // Replace & { from: /[/_,:;\\ ]/g, to: '-' }, // Replace /_,:;\. and whitespace { from: /--+/g, to: '-' }, // Replace multiple hyphens with single - { from: /^-/, to: '' }, // Remove any leading hyphen - { from: /-$/, to: '' }, // Remove any trailing hyphen + { from: /^-(?!($|-))|(? Date: Mon, 16 Feb 2026 17:38:29 -0500 Subject: [PATCH 2/3] fixup! --- src/utils/parser/constants.mjs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/utils/parser/constants.mjs b/src/utils/parser/constants.mjs index e10903b3..700afc67 100644 --- a/src/utils/parser/constants.mjs +++ b/src/utils/parser/constants.mjs @@ -6,7 +6,7 @@ export const DOC_API_SLUGS_REPLACEMENTS = [ { from: /&/, to: '-and-' }, // Replace & { from: /[/_,:;\\ ]/g, to: '-' }, // Replace /_,:;\. and whitespace { from: /--+/g, to: '-' }, // Replace multiple hyphens with single - { from: /^-(?!($|-))|(? Date: Mon, 16 Feb 2026 17:39:40 -0500 Subject: [PATCH 3/3] fixup! --- src/utils/parser/constants.mjs | 1 - 1 file changed, 1 deletion(-) diff --git a/src/utils/parser/constants.mjs b/src/utils/parser/constants.mjs index 700afc67..95301c8d 100644 --- a/src/utils/parser/constants.mjs +++ b/src/utils/parser/constants.mjs @@ -5,7 +5,6 @@ export const DOC_API_SLUGS_REPLACEMENTS = [ { from: /node.js/i, to: 'nodejs' }, // Replace Node.js { from: /&/, to: '-and-' }, // Replace & { from: /[/_,:;\\ ]/g, to: '-' }, // Replace /_,:;\. and whitespace - { from: /--+/g, to: '-' }, // Replace multiple hyphens with single { from: /^-(?!$|-)|(?