Skip to content

Playwright is a framework for Web Testing and Automation. It allows testing Chromium, Firefox and WebKit with a single API.

docs: fix table-of-contents generation (#3840)

Andrey Lushnikov45542a5334a4
diff --git a/docs/api.md b/docs/api.md
index a450e793d0..1c459dc74e 100644
--- a/docs/api.md
+++ b/docs/api.md
@@ -690,7 +690,7 @@ page.removeListener('request', logRequest);
```
<!-- GEN:toc -->
-- [event: '_videostarted'](#event-videostarted)
+- [event: '_videostarted'](#event-_videostarted)
- [event: 'close'](#event-close-1)
- [event: 'console'](#event-console)
- [event: 'crash'](#event-crash)
diff --git a/docs/ci.md b/docs/ci.md
index b2ca43491e..819c283dad 100644
--- a/docs/ci.md
+++ b/docs/ci.md
@@ -15,7 +15,7 @@ configurations for common CI providers.
* [Bitbucket Pipelines](#bitbucket-pipelines)
* [GitLab CI](#gitlab-ci)
- [Caching browsers](#caching-browsers)
- - [Exception: `node_modules` are cached](#exception-nodemodules-are-cached)
+ - [Exception: `node_modules` are cached](#exception-node_modules-are-cached)
- [Directories to cache](#directories-to-cache)
- [Debugging browser launches](#debugging-browser-launches)
- [Running headful](#running-headful)
@@ -102,7 +102,7 @@ Suggested configuration
Chromium in non-headless mode (e.g. to test Chrome Extensions)
1. If your project does not have `package-lock.json`, Travis would be auto-caching
`node_modules` directory. If you run `npm install` (instead of `npm ci`), it is
- possible that the browser binaries are not downloaded. Fix this with [these steps](#exception-nodemodules-are-cached) outlined below.
+ possible that the browser binaries are not downloaded. Fix this with [these steps](#exception-node_modules-are-cached) outlined below.
To sum up, your `.travis.yml` might look like this:
diff --git a/utils/doclint/preprocessor/index.js b/utils/doclint/preprocessor/index.js
index 146d32ae0b..500e196381 100644
--- a/utils/doclint/preprocessor/index.js
+++ b/utils/doclint/preprocessor/index.js
@@ -90,7 +90,7 @@ function getTOCEntriesForText(text) {
for (const {line, offset} of titles) {
const [, nesting, name] = line.match(titleRegex);
const delinkifiedName = name.replace(/\[([^\]]+)\]\([^)]+\)/g, '$1');
- const id = delinkifiedName.trim().toLowerCase().replace(/\s/g, '-').replace(/[^-0-9a-zа-яё]/ig, '');
+ const id = delinkifiedName.trim().toLowerCase().replace(/\s/g, '-').replace(/[^-_0-9a-zа-яё]/ig, '');
let dedupId = id;
let counter = 0;
while (ids.has(dedupId))