Skip to content
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

tools: fix man pages linking regex #17724

Closed
wants to merge 4 commits into from

Conversation

DiegoRBaquero
Copy link
Contributor

The change to word boundary was breaking many doc pages. This reverts the word boundary back to space.

Fixes: #17637
Fixes: #17694
Refs: #17479

Affected core subsystem(s)

tools, doc

The change to word boundary was breaking many doc pages. This reverts the word boundary back to space.

Fixes: nodejs#17637
Fixes: nodejs#17694
Refs: nodejs#17479
@nodejs-github-bot nodejs-github-bot added doc Issues and PRs related to the documentations. tools Issues and PRs related to the tools directory. labels Dec 18, 2017
DiegoRBaquero added a commit to DiegoRBaquero/node that referenced this pull request Dec 18, 2017
This add the space needed to match the man pages linking regex.

Refs: nodejs#17724
Copy link
Member

@Trott Trott left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think this should be reverted. Rather the regular expression should be refined. Will comment more...

@Trott
Copy link
Member

Trott commented Dec 18, 2017

Maybe replace word boundary \b with an allowance for spaces or the beginning of a line (^|\s). That will stop it from replacing if the word break is a non-alpha symbol like [ and ( but still work at the start of a line.

@lpinca
Copy link
Member

lpinca commented Dec 18, 2017

@Trott's suggestion sounds good. In addition to that we should replace the space with the value of the first capturing group (^|\s)in the returned string.

@DiegoRBaquero
Copy link
Contributor Author

@lpinca Indeed it would be needed, else a space would be removed.

The change to word boundary was breaking many doc pages. This replace the word boundary with a matching group of space or beginning of line.

Fixes: nodejs#17637
Fixes: nodejs#17694
Refs: nodejs#17479
if (BSD_ONLY_SYSCALLS.has(name)) {
return ` <a href="https://www.freebsd.org/cgi/man.cgi?query=${name}` +
return `<a href="https://www.freebsd.org/cgi/man.cgi?query=${name}` +
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think beginning should be used here, replacing the space.

Copy link
Member

@Trott Trott Dec 19, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@lpinca Same applies to line 427 too? Or am I mistaken about that?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes, that's correct.

This moves the beginning regex matching group to the beginning of the resulting HTML man pages link
@DiegoRBaquero
Copy link
Contributor Author

@Trott @lpinca Updated

Copy link
Member

@Trott Trott left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM if CI is ok

@lpinca
Copy link
Member

lpinca commented Dec 20, 2017

@maclover7
Copy link
Contributor

Landing for now as fixes main generation issue. Just noting for posterity that the curl and uname links referenced in #17637 are still broken, but it's for a different reason.

@maclover7 maclover7 self-assigned this Dec 22, 2017
@maclover7
Copy link
Contributor

maclover7 commented Dec 22, 2017

Landed in 66e6aff

@maclover7 maclover7 closed this Dec 22, 2017
maclover7 pushed a commit to maclover7/node that referenced this pull request Dec 22, 2017
The change to word boundary was breaking many doc pages. This reverts
the word boundary back to space.

PR-URL: nodejs#17724
Fixes: nodejs#17694
Refs: nodejs#17479
Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
@vsemozhetbyt
Copy link
Contributor

@maclover7 Hmm. The links referenced in #17637 seem to not match the new RegExp, so they should not be erroneously double-linkified now if I do not miss something.

@maclover7
Copy link
Contributor

@vsemozhetbyt I think our comments crossed -- see #17637 (comment)

@DiegoRBaquero DiegoRBaquero deleted the patch-1 branch December 23, 2017 23:53
MylesBorins pushed a commit that referenced this pull request Jan 8, 2018
The change to word boundary was breaking many doc pages. This reverts
the word boundary back to space.

PR-URL: #17724
Fixes: #17694
Refs: #17479
Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
MylesBorins pushed a commit that referenced this pull request Jan 9, 2018
The change to word boundary was breaking many doc pages. This reverts
the word boundary back to space.

PR-URL: #17724
Fixes: #17694
Refs: #17479
Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
MylesBorins pushed a commit that referenced this pull request Jan 9, 2018
The change to word boundary was breaking many doc pages. This reverts
the word boundary back to space.

PR-URL: #17724
Fixes: #17694
Refs: #17479
Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
@MylesBorins MylesBorins mentioned this pull request Jan 10, 2018
@vsemozhetbyt
Copy link
Contributor

cc @nodejs/lts: Can this be backported to v8 branch?
See #17694 (comment)

This was referenced Jan 22, 2018
gibfahn pushed a commit that referenced this pull request Jan 24, 2018
The change to word boundary was breaking many doc pages. This reverts
the word boundary back to space.

PR-URL: #17724
Fixes: #17694
Refs: #17479
Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
@gibfahn
Copy link
Member

gibfahn commented Jan 24, 2018

cc @nodejs/lts: Can this be backported to v8 branch?

Done. I assume it doesn't need to go back to the v6.x branch.

@vsemozhetbyt
Copy link
Contributor

@gibfahn Yes, it seems v6.x docs do not have this issue.

gibfahn pushed a commit that referenced this pull request Jan 24, 2018
The change to word boundary was breaking many doc pages. This reverts
the word boundary back to space.

PR-URL: #17724
Fixes: #17694
Refs: #17479
Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
doc Issues and PRs related to the documentations. tools Issues and PRs related to the tools directory.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

10 participants