-
Notifications
You must be signed in to change notification settings - Fork 22.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix all broken anchor links in JS docs #22140
Conversation
d643ad0
to
96728fa
Compare
96728fa
to
abffd36
Compare
Co-authored-by: Hamish Willee <[email protected]>
@@ -187,7 +187,7 @@ const myCar = { | |||
}; | |||
``` | |||
|
|||
Like JavaScript variables, property names are case sensitive. Property names can only be strings or Symbols — all keys are [converted to strings](/en-US/docs/Web/JavaScript/Reference/Global_Objects/String#string_coercion) unless they are Symbols. [Array indices](/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array#notes) are, in fact, properties with string keys that contain integers. | |||
Like JavaScript variables, property names are case sensitive. Property names can only be strings or Symbols — all keys are [converted to strings](/en-US/docs/Web/JavaScript/Reference/Global_Objects/String#string_coercion) unless they are Symbols. [Array indices](/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array#description) are, in fact, properties with string keys that contain integers. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
FWIW the notes section actually mentions "Array indicies", while the now-linked description does not. I prefer a description link.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The "Notes" section is now gone—I'll add a new heading instead.
@@ -67,4 +66,4 @@ if (Object.hasOwn(foo, 'bar')) { | |||
|
|||
## See also | |||
|
|||
- {{jsxref("Operators/Property_Accessors", "property accessors", 0, 1)}} | |||
- [Property accessors](/en-US/docs/Web/JavaScript/Reference/Operators/Property_Accessors) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
FWIW it's cases like this which make me much prefer normal links to macros.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Exactly :) I think at some point we should deprecate the 3rd and 4th arguments. I only use the first two and sometimes I find it very useful.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I supect the macro will disappear altogether, and possibly we will see the "/en-US/docs/Web.." format replaced by the file structure URL. We will see.
@@ -575,7 +581,7 @@ This rule is a complement to the previous rule, specifically for the case where | |||
- `(param) <here> => {}` | |||
- `async <here> function`, `async <here> prop()`, `async <here> function*`, `async <here> *prop()`, `async <here> (param) <here> => {}` | |||
|
|||
Here `++` is not treated as a [postfix operator](/en-US/docs/Web/JavaScript/Reference/Operators#increment) applying to variable `b`, because a line terminator occurs between `b` and `++`. | |||
Here [`++`](/en-US/docs/Web/JavaScript/Reference/Operators/Increment) is not treated as a postfix operator applying to variable `b`, because a line terminator occurs between `b` and `++`. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
All good, though this might clash with the change in the other PR we are discussing.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM. Even scripted, a bit of work in there.
Probably worth us running the script over the rest of the docs (hint). Small chunks to review though - hard to maintain concentration.
Yeah—I'm hesitant to run it over the entire corpus, partly because building all the HTML takes forever, partly because it often involves content refactoring and I'm not familiar with pages outside JS. |
Fair enough. Don't know how versatile your tool is - but I was thinking small chunks and sharing the load. |
Description
I wrote a little script that analyzes all anchor links in the HTML output. Ended up finding a handful of nonexistent anchors.
Motivation
Additional details
Related issues and pull requests