Skip to content

Commit

Permalink
tools: make internal link checker more robust
Browse files Browse the repository at this point in the history
The internal link checker was missing some broken links because it was
being too restrictive about the characters it accepted as part of a link
hash. Accept anything that isn't a terminating quotation mark.

Refs: nodejs#39426
Refs: nodejs#39425
  • Loading branch information
Trott committed Jul 18, 2021
1 parent 07e83f7 commit ae8c743
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion doc/api/http.md
Original file line number Diff line number Diff line change
Expand Up @@ -3183,7 +3183,7 @@ try {
[`net.Socket`]: net.md#net_class_net_socket
[`net.createConnection()`]: net.md#net_net_createconnection_options_connectlistener
[`new URL()`]: url.md#url_new_url_input_base
[`outgoingMessage.socket`]: #http_outgoingMessage.socket
[`outgoingMessage.socket`]: #http_outgoingmessage_socket
[`removeHeader(name)`]: #http_request_removeheader_name
[`request.destroy()`]: #http_request_destroy_error
[`request.end()`]: #http_request_end_data_encoding_callback
Expand Down
4 changes: 2 additions & 2 deletions tools/doc/allhtml.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -76,13 +76,13 @@ fs.writeFileSync(new URL('./all.html', source), all, 'utf8');

// Validate all hrefs have a target.
const ids = new Set();
const idRe = / id="(\w+)"/g;
const idRe = / id="([^"]+)"/g;
let match;
while (match = idRe.exec(all)) {
ids.add(match[1]);
}

const hrefRe = / href="#(\w+)"/g;
const hrefRe = / href="#([^"]+)"/g;
while (match = hrefRe.exec(all)) {
if (!ids.has(match[1])) throw new Error(`link not found: ${match[1]}`);
}
2 changes: 1 addition & 1 deletion tools/doc/type-parser.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ const customTypesMap = {
'EcKeyImportParams': 'webcrypto.html#webcrypto_class_eckeyimportparams',
'HmacImportParams': 'webcrypto.html#webcrypto_class_hmacimportparams',
'AesImportParams': 'webcrypto.html#webcrypto_class_aesimportparams',
'Pbkdf2ImportParams': 'webcrypto.html#webcrypto_class.pbkdf2importparams',
'Pbkdf2ImportParams': 'webcrypto.html#webcrypto_class_pbkdf2importparams',
'HmacParams': 'webcrypto.html#webcrypto_class_hmacparams',
'EcdsaParams': 'webcrypto.html#webcrypto_class_ecdsaparams',
'RsaPssParams': 'webcrypto.html#webcrypto_class_rsapssparams',
Expand Down

0 comments on commit ae8c743

Please sign in to comment.