Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions src/utils/parser/constants.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@ 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: /^-/, to: '' }, // Remove any leading hyphen
{ from: /-$/, to: '' }, // Remove any trailing hyphen
{ from: /^-+(?!-*$)/g, to: '' }, // Remove any leading hyphens
{ from: /(?<!^-*)-+$/g, to: '' }, // Remove any trailing hyphens
{ from: /^(?!-+$).*?(--+)/g, to: '-' }, // Replace multiple hyphens
];

// This is the base URL of the MDN Web documentation
Expand Down
Loading