-
Notifications
You must be signed in to change notification settings - Fork 29.7k
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
docs: Fix broken fg(1) links #11504
docs: Fix broken fg(1) links #11504
Conversation
|
67ac3e6
to
679dc58
Compare
tools/doc/html.js
Outdated
@@ -288,7 +288,7 @@ var BSD_ONLY_SYSCALLS = new Set(['lchmod']); | |||
// Returns modified text, with such refs replace with HTML links, for example | |||
// '<a href="http://man7.org/linux/man-pages/man2/open.2.html">open(2)</a>' | |||
function linkManPages(text) { | |||
return text.replace(/ ([a-z.]+)\((\d)\)/gm, function(match, name, number) { | |||
return text.replace(/ ([a-z.]+)\((\d[a-z]?)\)/gm, function(match, name, number) { |
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.
we need both the original and new match for this to return http://man7.org/linux/man-pages/man1/fg.1p.html
currently it will return /man-pages/man1p/
by the looks of it.
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.
@Fishrock123 Yup, I just noticed that. Fixing it.
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.
@Fishrock123 Fixed this. Do you think there should be a test for this?
@Fishrock123 Haven't found any concrete documentation around it but this is what I found in the changelog. (Ref: http://man7.org/linux/man-pages/changelog.html#release_2.50)
|
The fg(1) links in the readline docs have moved from `http://man7.org/linux/man-pages/man1/fg.1.html` to `http://man7.org/linux/man-pages/man1/fg.1p.html`. It also modifies the regex for replacing man page links in docs by allowing optional character after number. eg: fg(1) and fg(1p) will both be now parsed and replaced. Fixes: nodejs#11492
679dc58
to
c0429d1
Compare
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.
If you want, you can turn the function into an arrow function and the string concatenations into template strings, that would make the code a bit easier to read here.
This LGTM with or without that :)
@addaleax The only reason I did not feel like changing it to fat arrow and template strings was because the code around it was still in the old syntax. Do you think I should still go ahead with it? I don't mind making that change. |
@karanjthakkar We don’t really do bulk updates of code because that interferes with things like backporting and |
@addaleax Done :) |
This change looks okay, but I found three more things in http://man7.org/linux/man-pages/dir_all_alphabetic.html, which will not be matched by this. |
@thefourtheye thats interesting! But I couldn't seem to find any instances of man page references for those suffixes/commands being used inside the docs. If y'all think this PR should include that as well, then I can rework the regex to include that. |
@addaleax I've fixed the test for the json doctool. The CI build should pass now. |
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 think that would be a good idea, yes. (By the way, I read |
Landed in 6ae159f, resolved a minor conflict (neighbouring lines) while landing. Thanks for the PR! 🎉 |
The fg(1) links in the readline docs have moved from `http://man7.org/linux/man-pages/man1/fg.1.html` to `http://man7.org/linux/man-pages/man1/fg.1p.html`. It also modifies the regex for replacing man page links in docs by allowing optional character after number. eg: fg(1) and fg(1p) will both be now parsed and replaced. Fixes: #11492 PR-URL: #11504 Reviewed-By: Anna Henningsen <[email protected]> Reviewed-By: Jeremiah Senkpiel <[email protected]>
The fg(1) links in the readline docs have moved from `http://man7.org/linux/man-pages/man1/fg.1.html` to `http://man7.org/linux/man-pages/man1/fg.1p.html`. It also modifies the regex for replacing man page links in docs by allowing optional character after number. eg: fg(1) and fg(1p) will both be now parsed and replaced. Fixes: #11492 PR-URL: #11504 Reviewed-By: Anna Henningsen <[email protected]> Reviewed-By: Jeremiah Senkpiel <[email protected]>
This will need a backport PR if it needs to land in v6 or v4 |
Checklist
make -j4 test
(UNIX), orvcbuild test
(Windows) passesAffected core subsystem(s)
doc