We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 6c35d81 commit 0a0102aCopy full SHA for 0a0102a
1 file changed
src/utils/parser/constants.mjs
@@ -5,7 +5,9 @@ export const DOC_API_SLUGS_REPLACEMENTS = [
5
{ from: /node.js/i, to: 'nodejs' }, // Replace Node.js
6
{ from: /&/, to: '-and-' }, // Replace &
7
{ from: /[/_,:;\\ ]/g, to: '-' }, // Replace /_,:;\. and whitespace
8
- { from: /^-(?!$|-)|(?<!^|-)-$/g, to: '' }, // Remove any trailing or leading hyphen
+ { from: /^-+(?!-*$)/g, to: '' }, // Remove any leading hyphens
9
+ { from: /(?<!^-*)-+$/g, to: '' }, // Remove any trailing hyphens
10
+ { from: /^(?!-+$).*?(--+)/g, to: '-' }, // Replace multiple hyphens
11
];
12
13
// This is the base URL of the MDN Web documentation
0 commit comments