-
Notifications
You must be signed in to change notification settings - Fork 3.6k
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
(shell) Support multiline commands #2861
(shell) Support multiline commands #2861
Conversation
036b4b5
to
ccaa0fe
Compare
I think you have the right idea but this regular expression does not work. It actually excludes the last character.
now produces: <span class="hljs-meta">$</span><span class="bash"> /bin/s</span>h (notice the letter "h" is outside the "bash" span) |
@joshgoebel I think we need to use a negative lookbehind. Basically the line must not end with a line continuation, so the end of a line must not be preceded by zero or more spaces and the character "\". I'm not sure how it can be rewritten without a lookbehind because the end position should always be the end of the line ( |
Yep, not allowed as you pointed out because Safari still lags. So let's include the last character and use the look-ahead to find the end of line. end: /[^\\](?=\s*$)/, Thoughts? I pushed my changes. |
Oh nice, if it works then 👍 EDIT: I can confirm that this is working great 🎉 |
eb32176
to
f0afb7e
Compare
f0afb7e
to
9ba8984
Compare
@@ -32,6 +23,7 @@ New Languages: | |||
|
|||
Language Improvements: | |||
|
|||
- enh(shell) Add support for multiline commands with line continuation `\` (#2861) [Guillaume Grossetie][] |
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.
@joshgoebel I'm confused, this language improvement is not part of the 10.4.0-beta1 right?
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.
Correct really they heading should probably change. Betas aren’t the same as releases though they’re rolling so things just keep getting added until we have a release
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.
So really the header and should be 10.4 rolling or some such. I’ll give it some thought. I only updated it because we have to update the header for production releases but that’s not true for beta releases so we have more flexibility there.
resolve #2860
Changes
Add support for multi-line commands using the line continuation
\
.Checklist
CHANGES.md
AUTHORS.txt
, under Contributors