Skip to content

Commit 0a0102a

Browse files
committed
fixup!
1 parent 6c35d81 commit 0a0102a

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

src/utils/parser/constants.mjs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,9 @@ export const DOC_API_SLUGS_REPLACEMENTS = [
55
{ from: /node.js/i, to: 'nodejs' }, // Replace Node.js
66
{ from: /&/, to: '-and-' }, // Replace &
77
{ from: /[/_,:;\\ ]/g, to: '-' }, // Replace /_,:;\. and whitespace
8-
{ from: /^-(?!$|-)|(?<!^|-)-$/g, to: '' }, // Remove any trailing or leading hyphen
8+
{ from: /^-+(?!-*$)/g, to: '' }, // Remove any leading hyphens
9+
{ from: /(?<!^-*)-+$/g, to: '' }, // Remove any trailing hyphens
10+
{ from: /^(?!-+$).*?(--+)/g, to: '-' }, // Replace multiple hyphens
911
];
1012

1113
// This is the base URL of the MDN Web documentation

0 commit comments

Comments
 (0)