Uh oh!
There was an error while loading. Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork 34.4k
doc: fix header escaping regression (Issue #22065)#22084
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
Uh oh!
There was an error while loading. Please reload this page.
Conversation
rubys commented Aug 2, 2018 • edited by refack
Loading Uh oh!
There was an error while loading. Please reload this page.
edited by refack
Uh oh!
There was an error while loading. Please reload this page.
tools/doc/html.js Outdated
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.
Maybe just:
.replace(/\\(?=.)/g,''),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.
Or, if we need to exclude escaped escapes:
.replace(/\\(?=[^\\])/g,''),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.
jslint doesn't accept .replace(/\\(?=.)/g, ''),:
/Users/rubys/git/node/tools/doc/html.js 202:29 error Unescaped dot character in regular expression node-core/no-unescaped-regexp-dot I want to include escaped escapes.
Finally, lookahead isn't appropriate here. If we have an escaped escape, I want to emit a single backslash and then to not consider that backslash as an escape character. Consider four escapes in a row, the desired result would be two backslashes:
> "\\\\\\\\".replace(/\\(?=.)/g, '').length 1 > "\\\\\\\\".replace(/\\.{1}/g, (match) => match[1]).length 2 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.
What about .replace(/\\(.{1})/g, '$1'),? Whould it be simpler and faster then function call and string index access?
vsemozhetbytAug 2, 2018 • edited
Loading Uh oh!
There was an error while loading. Please reload this page.
edited
Uh oh!
There was an error while loading. Please reload this page.
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.
BTW, we can disable linter rule for a line to simplify RegExp, but I am not sure what is more confusing:
// eslint-disable-next-line node-core/no-unescaped-regexp-dot.replace(/\\./g,(match)=>match[1]),vsemozhetbyt commented Aug 2, 2018
vsemozhetbyt commented Aug 2, 2018
Not sure what is wrong with CI. Is it infrastructural fails? |
rubys commented Aug 2, 2018
Somebody either changed the version of Between the two, I would say that changing the build script seems considerably more likely. The second slash just looks outright wrong. Perhaps they meant to have a backslash escaping the next backslash so that they shell would pass |
This comment has been minimized.
This comment has been minimized.
Trott commented Aug 2, 2018
richardlau commented Aug 3, 2018
Looks to be a real failure: https://ci.nodejs.org/job/node-test-commit-linuxone/3483/nodes=rhel72-s390x/consoleFull |
tools/doc/html.js Outdated
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.
Missing trailing comma?
vsemozhetbyt commented Aug 3, 2018
vsemozhetbyt commented Aug 3, 2018
Node.js Collaborators, please, add 👍 here if you approve fast-tracking. |
vsemozhetbyt commented Aug 3, 2018
It seems we have one more similar regression case: HTML entities verbatim rendering: Not sure if this should be fixed in this PR or in a new one. |
jasnell commented Aug 3, 2018 • edited
Loading Uh oh!
There was an error while loading. Please reload this page.
edited
Uh oh!
There was an error while loading. Please reload this page.
@rubys ... just a nit the prefix for the commit message here should be Also, just as a convention, it is helpful to include a |
rubys commented Aug 5, 2018
My pull request for https://www.npmjs.com/package/mdast-util-to-hast has been accepted. Updating to the latest version of this dependency should fix everything. In fact, I should be able to back out some of the work that is currently committed. I'll run some tests and see what needs to be done from there. |
jasnell commented Aug 12, 2018
@rubys ... is this ready to go? |
rubys commented Aug 12, 2018
@jasnell: this PR is an accumulated set of workarounds to a remark bug, it certainly can go in now, but will all need to be backed out when these pull requests land: #22140 (comment) |
Preferred long term fix can be found at: nodejs#22140
rubys commented Aug 13, 2018
rubys commented Aug 13, 2018
My read is that the freebsd failure is unrelated. Unless there are any objections, I'll land this PR tomorrow. |
quick fix for #22065 Preferred long term fix can be found at: #22140 PR-URL: #22084Fixes: #22065 Reviewed-By: Vse Mozhet Byt <[email protected]> Reviewed-By: James M Snell <[email protected]> Reviewed-By: Trivikram Kamat <[email protected]>
rubys commented Aug 13, 2018
Landed in 59f8276 |
quick fix for #22065 Preferred long term fix can be found at: #22140 PR-URL: #22084Fixes: #22065 Reviewed-By: Vse Mozhet Byt <[email protected]> Reviewed-By: James M Snell <[email protected]> Reviewed-By: Trivikram Kamat <[email protected]>
quick fix for #22065 Preferred long term fix can be found at: nodejs/node#22140 PR-URL: nodejs/node#22084Fixes: nodejs/node#22065 Reviewed-By: Vse Mozhet Byt <[email protected]> Reviewed-By: James M Snell <[email protected]> Reviewed-By: Trivikram Kamat <[email protected]>
Remove backslashes in headers.
Fixes: #22065
Checklist
make -j4 test(UNIX), orvcbuild test(Windows) passes