-
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
Merged
joshgoebel
merged 3 commits into
highlightjs:master
from
ggrossetie:issue-2860-command-line-continuation
Nov 15, 2020
Merged
Changes from all commits
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -309,3 +309,4 @@ Contributors: | |
- Patrick Scheibe <[email protected]> | ||
- Kyle Brown <kylebrown9@github> | ||
- Marcus Ortiz <[email protected]> | ||
- Guillaume Grossetie <[email protected]> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,18 +3,21 @@ Language: Shell Session | |
Requires: bash.js | ||
Author: TSUYUSATO Kitsune <[email protected]> | ||
Category: common | ||
Audit: 2020 | ||
*/ | ||
|
||
/** @type LanguageFn */ | ||
export default function(hljs) { | ||
return { | ||
name: 'Shell Session', | ||
aliases: ['console'], | ||
contains: [ | ||
{ | ||
className: 'meta', | ||
begin: '^\\s{0,3}[/\\w\\d\\[\\]()@-]*[>%$#]', | ||
begin: /^\s{0,3}[/\w\d[\]()@-]*[>%$#]/, | ||
starts: { | ||
end: '$', subLanguage: 'bash' | ||
end: /[^\\](?=\s*$)/, | ||
subLanguage: 'bash' | ||
} | ||
} | ||
] | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
<span class="hljs-meta">$</span><span class="bash"> docker run \ | ||
--publish=7474:7474 --publish=7687:7687 \ | ||
--volume=/neo4j/data:/data \ | ||
--volume=/neo4j/plugins:/plugins \ | ||
--volume=/neo4j/conf:/conf \ | ||
--volume=/logs/neo4j:/logs \ | ||
--user=<span class="hljs-string">"<span class="hljs-subst">$(id -u neo4j)</span>:<span class="hljs-subst">$(id -g neo4j)</span>"</span> \ | ||
--group-add=<span class="hljs-variable">$groups</span> \ | ||
neo4j:3.4</span> | ||
<span class="hljs-meta">></span><span class="bash"> /bin/cat \.travis.yml\ | ||
-b | head -n1</span> | ||
1 language: node_js | ||
<span class="hljs-meta">></span><span class="bash"> <span class="hljs-built_in">echo</span> <span class="hljs-string">'hello'</span></span> | ||
hello |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
$ docker run \ | ||
--publish=7474:7474 --publish=7687:7687 \ | ||
--volume=/neo4j/data:/data \ | ||
--volume=/neo4j/plugins:/plugins \ | ||
--volume=/neo4j/conf:/conf \ | ||
--volume=/logs/neo4j:/logs \ | ||
--user="$(id -u neo4j):$(id -g neo4j)" \ | ||
--group-add=$groups \ | ||
neo4j:3.4 | ||
> /bin/cat \.travis.yml\ | ||
-b | head -n1 | ||
1 language: node_js | ||
> echo 'hello' | ||
hello |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
<span class="hljs-meta">></span><span class="bash"> /bin/sh</span> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
> /bin/sh |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
<span class="hljs-meta">$</span><span class="bash"> <span class="hljs-built_in">echo</span> <span class="hljs-string">"<span class="hljs-variable">$HOME</span>"</span> -n</span> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
$ echo "$HOME" -n |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.