-
-
Notifications
You must be signed in to change notification settings - Fork 35.1k
Description
Affected URLS
- https://nodejs.org/docs/latest/api/modules.html#__filename
- https://nodejs.org/docs/latest/api/modules.html#__dirname
Problem
Those links refer to an HTML element with the ID __dirname or __filename instead of using the IDs without the underscores, because when the documentation content is generated, it appears to remove the underscores and generates IDs without underscores. You can find those links on this page: https://nodejs.org/docs/latest/api/globals.html#global-objects
The modules.md file also references __dirname and __filename several times, so this page also contains broken anchor links: https://nodejs.org/docs/latest/api/modules.html
Possible Cause
I think the problem is related to this: https://github.com/nodejs/doc-kit/blob/d9697c7fbbbddeca58f9dc71693d4af9774455e0/src/generators/metadata/constants.mjs#L12
I was thinking about changing the link in the files listed below, but I think that would break the link (at least in GitHub's Markdown editor), so that wouldn't be a good solution.
Lines 14 to 30 in 61102cd
| * [`__dirname`][] | |
| * [`__filename`][] | |
| * [`exports`][] | |
| * [`module`][] | |
| * [`require()`][] | |
| The objects listed here are specific to Node.js. There are [built-in objects][] | |
| that are part of the JavaScript language itself, which are also globally | |
| accessible. | |
| ## `__dirname` | |
| This variable may appear to be global but is not. See [`__dirname`][]. | |
| ## `__filename` | |
| This variable may appear to be global but is not. See [`__filename`][]. |