Skip to content

Commit 3b617b3

Browse files
authored
docs: validate member links (#4955)
1 parent b7e0b1b commit 3b617b3

File tree

2 files changed

+12
-1
lines changed

2 files changed

+12
-1
lines changed

docs/src/auth.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ existing authentication state in new browser contexts.
6969
Web apps use cookie-based or token-based authentication, where authenticated
7070
state is stored as [cookies](https://developer.mozilla.org/en-US/docs/Web/HTTP/Cookies)
7171
or in [local storage](https://developer.mozilla.org/en-US/docs/Web/API/Storage).
72-
Playwright provides [`method: Browser.storageState`] method that can be used to retrieve storage state from authenticated contexts and then create new contexts with prepopulated state.
72+
Playwright provides [`method: BrowserContext.storageState`] method that can be used to retrieve storage state from authenticated contexts and then create new contexts with prepopulated state.
7373

7474
Cookies and local storage state can be used across different browsers. They depend
7575
on your application's authentication model: some apps might require both cookies

utils/doclint/cli.js

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ const fs = require('fs');
2222
const path = require('path');
2323
const { parseApi } = require('./api_parser');
2424
const missingDocs = require('./missingDocs');
25+
const md = require('../markdown');
2526

2627
/** @typedef {import('./documentation').Type} Type */
2728
/** @typedef {import('../markdown').MarkdownNode} MarkdownNode */
@@ -64,6 +65,16 @@ async function run() {
6465
writeAssumeNoop(path.join(PROJECT_DIR, 'README.md'), content, dirtyFiles);
6566
}
6667

68+
// Validate links
69+
{
70+
for (const file of fs.readdirSync(path.join(PROJECT_DIR, 'docs', 'src'))) {
71+
if (!file.endsWith('.md'))
72+
continue;
73+
const data = fs.readFileSync(path.join(PROJECT_DIR, 'docs', 'src', file)).toString();
74+
documentation.renderLinksInText(md.parse(data));
75+
}
76+
}
77+
6778
// Check for missing docs
6879
{
6980
const srcClient = path.join(PROJECT_DIR, 'src', 'client');

0 commit comments

Comments
 (0)