Skip to content

Commit

Permalink
chore(audit) shell
Browse files Browse the repository at this point in the history
  • Loading branch information
joshgoebel authored and ggrossetie committed Nov 15, 2020
1 parent 90e60cf commit eb32176
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/languages/shell.js
Expand Up @@ -3,18 +3,21 @@ Language: Shell Session
Requires: bash.js
Author: TSUYUSATO Kitsune <make.just.on@gmail.com>
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: '[^\\\\](?=\\s*$)', subLanguage: 'bash'
end: /[^\\](?=\s*$)/,
subLanguage: 'bash'
}
}
]
Expand Down
5 changes: 5 additions & 0 deletions test/markup/shell/command-continuation-alt.expect.txt
@@ -0,0 +1,5 @@
<span class="hljs-meta">&gt;</span><span class="bash"> /bin/cat \.travis.yml\
-b | head -n1</span>
1 language: node_js
<span class="hljs-meta">&gt;</span><span class="bash"> <span class="hljs-built_in">echo</span> <span class="hljs-string">&#x27;hello&#x27;</span></span>
hello
5 changes: 5 additions & 0 deletions test/markup/shell/command-continuation-alt.txt
@@ -0,0 +1,5 @@
> /bin/cat \.travis.yml\
-b | head -n1
1 language: node_js
> echo 'hello'
hello

0 comments on commit eb32176

Please sign in to comment.