diff --git a/docs/.eleventy.js b/docs/.eleventy.js
index 01801d389e3..f2edb5393a1 100644
--- a/docs/.eleventy.js
+++ b/docs/.eleventy.js
@@ -71,8 +71,26 @@ module.exports = function(eleventyConfig) {
*/
function slugify(text) {
return slug(text.replace(/[<>()[\]{}]/gu, ""))
- // eslint-disable-next-line no-control-regex -- used regex from https://github.com/eslint/archive-website/blob/master/_11ty/plugins/markdown-plugins.js#L37
- .replace(/[^\u{00}-\u{FF}]/gu, "");
+ /* eslint-disable no-control-regex, require-unicode-regexp -- used regex from https://github.com/eslint/archive-website/blob/master/_11ty/plugins/markdown-plugins.js#L37*/
+
+ // Remove control characters
+ .replace(/[\u0000-\u001F]/g, "")
+
+ // replace special characters
+ .replace(/[\s~`!@#$%^&*()\-_+=[\]{}|\\;:"'<>,.?/]+/g, "-")
+
+ // remove continuos separators
+
+ .replace(/-{2,}/g, "-")
+
+ // remove prefixing and trailing separtors
+ .replace(/^-+|-+$/g, "")
+
+ /* eslint-enable no-control-regex, require-unicode-regexp -- end */
+
+ // lowercase
+ .toLowerCase();
+
}
eleventyConfig.addFilter("slugify", str => {
@@ -193,7 +211,7 @@ module.exports = function(eleventyConfig) {
const markdownIt = require("markdown-it");
const md = markdownIt({ html: true, linkify: true, typographer: true, highlight: (str, lang) => highlighter(md, str, lang) })
.use(markdownItAnchor, {
- slugify
+ slugify: s => slugify(s)
})
.use(markdownItContainer, "correct", {})
.use(markdownItContainer, "incorrect", {})
diff --git a/docs/src/developer-guide/nodejs-api.md b/docs/src/developer-guide/nodejs-api.md
index 833a678d722..72f5f2cef22 100644
--- a/docs/src/developer-guide/nodejs-api.md
+++ b/docs/src/developer-guide/nodejs-api.md
@@ -69,7 +69,7 @@ const { ESLint } = require("eslint");
});
```
-### ◆ new ESLint(options)
+### new ESLint(options)
```js
const eslint = new ESLint(options);
@@ -133,7 +133,7 @@ The `ESLint` constructor takes an `options` object. If you omit the `options` ob
* `options.cacheStrategy` (`string`)
Default is `"metadata"`. Strategy for the cache to use for detecting changed files. Can be either `"metadata"` or `"content"`.
-### ◆ eslint.lintFiles(patterns)
+### eslint.lintFiles(patterns)
```js
const results = await eslint.lintFiles(patterns);
@@ -151,7 +151,7 @@ This method lints the files that match the glob patterns and then returns the re
* (`Promise`)
The promise that will be fulfilled with an array of [LintResult] objects.
-### ◆ eslint.lintText(code, options)
+### eslint.lintText(code, options)
```js
const results = await eslint.lintText(code, options);
@@ -179,7 +179,7 @@ The second parameter `options` is omittable.
* (`Promise`)
The promise that will be fulfilled with an array of [LintResult] objects. This is an array (despite there being only one lint result) in order to keep the interfaces between this and the [`eslint.lintFiles()`][eslint-lintfiles] method similar.
-### ◆ eslint.getRulesMetaForResults(results)
+### eslint.getRulesMetaForResults(results)
```js
const results = await eslint.lintFiles(patterns);
@@ -198,7 +198,7 @@ This method returns an object containing meta information for each rule that tri
* (`Object`)
An object whose property names are the rule IDs from the `results` and whose property values are the rule's meta information (if available).
-### ◆ eslint.calculateConfigForFile(filePath)
+### eslint.calculateConfigForFile(filePath)
```js
const config = await eslint.calculateConfigForFile(filePath);
@@ -222,7 +222,7 @@ This method calculates the configuration for a given file, which can be useful f
* (`Promise