diff --git a/lib/generate-doc.js b/lib/generate-doc.js index 803f132..46b5c9e 100644 --- a/lib/generate-doc.js +++ b/lib/generate-doc.js @@ -102,7 +102,7 @@ function processComplexMatch (thing, keys) { // (i.e. /:id, /:name, etc...) with the name(s) of those parameter(s) // This could have been accomplished with replaceAll for Node version 15 and above // no-useless-escape is disabled since we need three backslashes - .replace(/\(\?\:\(\[\^\\\/\]\+\?\)\)/g, () => `{${keys[i++].name}}`) // eslint-disable-line no-useless-escape + .replace(/(?:\\\/)?\(\?\:(?:\\\/)?\(\[\^(?:\\)?\/\]\+\?\)\)\\\//g, () => `/{${keys[i++].name}}/`) // eslint-disable-line no-useless-escape .replace(/\\(.)/g, '$1') // The replace below removes the regex used at the start of the string and // the regex used to match the query parameters