Skip to content

Commit 5f8d64f

Browse files
committed
doc: fix links to ECMAScript module resolution
The heading in esm.md was changed from "Resolver Algorithm Specification" to "Resolution Algorithm Specification" back in ccada8b. This also makes use of the changes in the previous commit to rewrite the links to point to the generated HTML.
1 parent f883942 commit 5f8d64f

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

doc/api/modules.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -235,7 +235,7 @@ the `require.resolve()` function.
235235
Putting together all of the above, here is the high-level algorithm
236236
in pseudocode of what `require()` does:
237237

238-
<pre>
238+
```pre html
239239
require(X) from module at path Y
240240
1. If X is a core module,
241241
a. return the core module
@@ -256,7 +256,7 @@ MAYBE_DETECT_AND_LOAD(X)
256256
1. If X parses as a CommonJS module, load X as a CommonJS module. STOP.
257257
2. Else, if `--experimental-require-module` and `--experimental-detect-module` are
258258
enabled, and the source code of X can be parsed as ECMAScript module using
259-
<a href="esm.md#resolver-algorithm-specification">DETECT_MODULE_SYNTAX defined in
259+
<a href="esm.md#resolution-algorithm-specification">DETECT_MODULE_SYNTAX defined in
260260
the ESM resolver</a>,
261261
a. Load X as an ECMAScript module. STOP.
262262
3. THROW the SyntaxError from attempting to parse X as CommonJS in 1. STOP.
@@ -318,7 +318,7 @@ LOAD_PACKAGE_IMPORTS(X, DIR)
318318
2. If no scope was found, return.
319319
3. If the SCOPE/package.json "imports" is null or undefined, return.
320320
4. let MATCH = PACKAGE_IMPORTS_RESOLVE(X, pathToFileURL(SCOPE),
321-
["node", "require"]) <a href="esm.md#resolver-algorithm-specification">defined in the ESM resolver</a>.
321+
["node", "require"]) <a href="esm.md#resolution-algorithm-specification">defined in the ESM resolver</a>.
322322
5. RESOLVE_ESM_MATCH(MATCH).
323323
324324
LOAD_PACKAGE_EXPORTS(X, DIR)
@@ -329,7 +329,7 @@ LOAD_PACKAGE_EXPORTS(X, DIR)
329329
3. Parse DIR/NAME/package.json, and look for "exports" field.
330330
4. If "exports" is null or undefined, return.
331331
5. let MATCH = PACKAGE_EXPORTS_RESOLVE(pathToFileURL(DIR/NAME), "." + SUBPATH,
332-
`package.json` "exports", ["node", "require"]) <a href="esm.md#resolver-algorithm-specification">defined in the ESM resolver</a>.
332+
`package.json` "exports", ["node", "require"]) <a href="esm.md#resolution-algorithm-specification">defined in the ESM resolver</a>.
333333
6. RESOLVE_ESM_MATCH(MATCH)
334334
335335
LOAD_PACKAGE_SELF(X, DIR)
@@ -339,15 +339,15 @@ LOAD_PACKAGE_SELF(X, DIR)
339339
4. If the SCOPE/package.json "name" is not the first segment of X, return.
340340
5. let MATCH = PACKAGE_EXPORTS_RESOLVE(pathToFileURL(SCOPE),
341341
"." + X.slice("name".length), `package.json` "exports", ["node", "require"])
342-
<a href="esm.md#resolver-algorithm-specification">defined in the ESM resolver</a>.
342+
<a href="esm.md#resolution-algorithm-specification">defined in the ESM resolver</a>.
343343
6. RESOLVE_ESM_MATCH(MATCH)
344344
345345
RESOLVE_ESM_MATCH(MATCH)
346346
1. let RESOLVED_PATH = fileURLToPath(MATCH)
347347
2. If the file at RESOLVED_PATH exists, load RESOLVED_PATH as its extension
348348
format. STOP
349349
3. THROW "not found"
350-
</pre>
350+
```
351351

352352
## Caching
353353

0 commit comments

Comments
 (0)