diff --git a/doc/api/buffer.md b/doc/api/buffer.md index 9cb6e540f41..b338811548a 100644 --- a/doc/api/buffer.md +++ b/doc/api/buffer.md @@ -464,7 +464,7 @@ changes: description: No longer experimental. --> -A [`Blob`][] encapsulates immutable, raw data that can be safely shared across +A {Blob} encapsulates immutable, raw data that can be safely shared across multiple worker threads. ### `new buffer.Blob([sources[, options]])` @@ -5522,7 +5522,6 @@ introducing security vulnerabilities into an application. [UTF-16]: https://en.wikipedia.org/wiki/UTF-16 [UTF-8]: https://en.wikipedia.org/wiki/UTF-8 [WHATWG Encoding Standard]: https://encoding.spec.whatwg.org/ -[`Blob`]: https://developer.mozilla.org/en-US/docs/Web/API/Blob [`Buffer.alloc()`]: #static-method-bufferallocsize-fill-encoding [`Buffer.allocUnsafe()`]: #static-method-bufferallocunsafesize [`Buffer.allocUnsafeSlow()`]: #static-method-bufferallocunsafeslowsize diff --git a/doc/api/cli.md b/doc/api/cli.md index 04a0ce88120..20d4573fade 100644 --- a/doc/api/cli.md +++ b/doc/api/cli.md @@ -1814,7 +1814,7 @@ For more information, see the [TypeScript type-stripping][] documentation. added: v22.0.0 --> -Disable exposition of [`WebSocket`][] on the global scope. +Disable exposition of {WebSocket} on the global scope. ### `--no-extra-info-on-fatal-exception` @@ -3917,7 +3917,6 @@ node --stack-trace-limit=12 -p -e "Error.stackTraceLimit" # prints 12 [`NO_COLOR`]: https://no-color.org [`SlowBuffer`]: buffer.md#class-slowbuffer [`Web Storage`]: https://developer.mozilla.org/en-US/docs/Web/API/Web_Storage_API -[`WebSocket`]: https://developer.mozilla.org/en-US/docs/Web/API/WebSocket [`YoungGenerationSizeFromSemiSpaceSize`]: https://chromium.googlesource.com/v8/v8.git/+/refs/tags/10.3.129/src/heap/heap.cc#328 [`dns.lookup()`]: dns.md#dnslookuphostname-options-callback [`dns.setDefaultResultOrder()`]: dns.md#dnssetdefaultresultorderorder diff --git a/doc/api/globals.md b/doc/api/globals.md index f9f8db9a784..057bb296358 100644 --- a/doc/api/globals.md +++ b/doc/api/globals.md @@ -36,7 +36,7 @@ changes: A utility class used to signal cancelation in selected `Promise`-based APIs. -The API is based on the Web API [`AbortController`][]. +The API is based on the Web API {AbortController}. ```js const ac = new AbortController(); @@ -453,7 +453,7 @@ changes: -A browser-compatible implementation of the [`CustomEvent` Web API][]. +A browser-compatible implementation of {CustomEvent}. ## Class: `DecompressionStream` @@ -493,7 +493,7 @@ added: v22.3.0 > Stability: 1 - Experimental. Enable this API with the [`--experimental-eventsource`][] > CLI flag. -A browser-compatible implementation of the [`EventSource`][] class. +A browser-compatible implementation of {EventSource}. ## `EventTarget` @@ -685,7 +685,7 @@ added: v15.0.0 -The `MessageEvent` class. See [`MessageEvent`][] for more details. +A browser-compatible implementation of {MessageEvent}. ## `MessagePort` @@ -1121,10 +1121,10 @@ added: v0.0.1 added: v22.4.0 --> -> Stability: 1.0 - Early development. +> Stability: 1.0 - Early development. Enable this API with the +> [`--experimental-webstorage`][] CLI flag. -A browser-compatible implementation of [`Storage`][]. Enable this API with the -[`--experimental-webstorage`][] CLI flag. +A browser-compatible implementation of {Storage}. ## `structuredClone(value[, options])` @@ -1167,7 +1167,7 @@ added: v17.0.0 -The WHATWG `DOMException` class. See [`DOMException`][] for more details. +The WHATWG {DOMException} class. ## `TextDecoder` @@ -1298,7 +1298,7 @@ changes: > Stability: 2 - Stable -A browser-compatible implementation of [`WebSocket`][]. Disable this API +A browser-compatible implementation of {WebSocket}. Disable this API with the [`--no-experimental-websocket`][] CLI flag. ## Class: `WritableStream` @@ -1350,17 +1350,12 @@ A browser-compatible implementation of [`WritableStreamDefaultWriter`][]. [`--no-experimental-global-navigator`]: cli.md#--no-experimental-global-navigator [`--no-experimental-global-webcrypto`]: cli.md#--no-experimental-global-webcrypto [`--no-experimental-websocket`]: cli.md#--no-experimental-websocket -[`AbortController`]: https://developer.mozilla.org/en-US/docs/Web/API/AbortController [`ByteLengthQueuingStrategy`]: webstreams.md#class-bytelengthqueuingstrategy [`CompressionStream`]: webstreams.md#class-compressionstream [`CountQueuingStrategy`]: webstreams.md#class-countqueuingstrategy -[`CustomEvent` Web API]: https://dom.spec.whatwg.org/#customevent -[`DOMException`]: https://developer.mozilla.org/en-US/docs/Web/API/DOMException [`DecompressionStream`]: webstreams.md#class-decompressionstream -[`EventSource`]: https://developer.mozilla.org/en-US/docs/Web/API/EventSource [`EventTarget` and `Event` API]: events.md#eventtarget-and-event-api [`MessageChannel`]: worker_threads.md#class-messagechannel -[`MessageEvent`]: https://developer.mozilla.org/en-US/docs/Web/API/MessageEvent/MessageEvent [`MessagePort`]: worker_threads.md#class-messageport [`PerformanceEntry`]: perf_hooks.md#class-performanceentry [`PerformanceMark`]: perf_hooks.md#class-performancemark @@ -1374,7 +1369,6 @@ A browser-compatible implementation of [`WritableStreamDefaultWriter`][]. [`ReadableStreamDefaultController`]: webstreams.md#class-readablestreamdefaultcontroller [`ReadableStreamDefaultReader`]: webstreams.md#class-readablestreamdefaultreader [`ReadableStream`]: webstreams.md#class-readablestream -[`Storage`]: https://developer.mozilla.org/en-US/docs/Web/API/Storage [`TextDecoderStream`]: webstreams.md#class-textdecoderstream [`TextDecoder`]: util.md#class-utiltextdecoder [`TextEncoderStream`]: webstreams.md#class-textencoderstream @@ -1383,7 +1377,6 @@ A browser-compatible implementation of [`WritableStreamDefaultWriter`][]. [`TransformStream`]: webstreams.md#class-transformstream [`URLSearchParams`]: url.md#class-urlsearchparams [`URL`]: url.md#class-url -[`WebSocket`]: https://developer.mozilla.org/en-US/docs/Web/API/WebSocket [`WritableStreamDefaultController`]: webstreams.md#class-writablestreamdefaultcontroller [`WritableStreamDefaultWriter`]: webstreams.md#class-writablestreamdefaultwriter [`WritableStream`]: webstreams.md#class-writablestream diff --git a/doc/api/http.md b/doc/api/http.md index 60a13bdd523..f17f6cc6476 100644 --- a/doc/api/http.md +++ b/doc/api/http.md @@ -4239,7 +4239,7 @@ added: - v22.5.0 --> -A browser-compatible implementation of [`WebSocket`][]. +A browser-compatible implementation of {WebSocket}. [RFC 8187]: https://www.rfc-editor.org/rfc/rfc8187.txt [`'ERR_HTTP_CONTENT_LENGTH_MISMATCH'`]: errors.md#err_http_content_length_mismatch @@ -4257,7 +4257,6 @@ A browser-compatible implementation of [`WebSocket`][]. [`Headers`]: globals.md#class-headers [`TypeError`]: errors.md#class-typeerror [`URL`]: url.md#the-whatwg-url-api -[`WebSocket`]: https://developer.mozilla.org/en-US/docs/Web/API/WebSocket [`agent.createConnection()`]: #agentcreateconnectionoptions-callback [`agent.getName()`]: #agentgetnameoptions [`destroy()`]: #agentdestroy diff --git a/tools/doc/type-parser.mjs b/tools/doc/type-parser.mjs index f9b0899ae22..535852ede23 100644 --- a/tools/doc/type-parser.mjs +++ b/tools/doc/type-parser.mjs @@ -1,4 +1,5 @@ -const jsDocPrefix = 'https://developer.mozilla.org/en-US/docs/Web/JavaScript/'; +const mdnPrefix = 'https://developer.mozilla.org/en-US/docs/Web'; +const jsDocPrefix = `${mdnPrefix}/JavaScript/`; const jsDataStructuresUrl = `${jsDocPrefix}Data_structures`; const jsPrimitives = { @@ -32,8 +33,7 @@ const customTypesMap = { 'AbortController': 'globals.html#class-abortcontroller', 'AbortSignal': 'globals.html#class-abortsignal', - 'ArrayBufferView': - 'https://developer.mozilla.org/en-US/docs/Web/API/ArrayBufferView', + 'ArrayBufferView': `${mdnPrefix}/API/ArrayBufferView`, 'AsyncIterator': 'https://tc39.github.io/ecma262/#sec-asynciterator-interface', @@ -137,6 +137,14 @@ const customTypesMap = { 'CustomEvent': 'events.html#class-customevent', 'EventListener': 'events.html#event-listener', + 'CloseEvent': `${mdnPrefix}/API/CloseEvent`, + 'EventSource': `${mdnPrefix}/API/EventSource`, + 'MessageEvent': `${mdnPrefix}/API/MessageEvent`, + + 'DOMException': `${mdnPrefix}/API/DOMException`, + 'Storage': `${mdnPrefix}/API/Storage`, + 'WebSocket': `${mdnPrefix}/API/WebSocket`, + 'FileHandle': 'fs.html#class-filehandle', 'fs.Dir': 'fs.html#class-fsdir', 'fs.Dirent': 'fs.html#class-fsdirent',