Skip to content

Commit

Permalink
resolves #2858 recognize prompt that contain tilde(s) and/or space(s)
Browse files Browse the repository at this point in the history
  • Loading branch information
ggrossetie committed Nov 13, 2020
1 parent e8a8216 commit 097acfc
Show file tree
Hide file tree
Showing 5 changed files with 27 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/languages/shell.js
Expand Up @@ -12,7 +12,7 @@ export default function(hljs) {
contains: [
{
className: 'meta',
begin: '^\\s{0,3}[/\\w\\d\\[\\]()@-]*[>%$#]',
begin: '^\\s{0,3}[/~\\s\\w\\d\\[\\]()@-]*[>%$#]',
starts: {
end: '$', subLanguage: 'bash'
}
Expand Down
9 changes: 9 additions & 0 deletions test/markup/shell/prompt-with-space.expect.txt
@@ -0,0 +1,9 @@
<span class="hljs-meta">[root@localhost ~]#</span><span class="bash"> yum list --show-duplicates neo4j-enterprise</span>
Loaded plugins: fastestmirror, langpacks
Loading mirror speeds from cached hostfile
* base: mirror.cc.columbia.edu
* extras: mirror.es.its.nyu.edu
* rpmforge: repoforge.mirror.constant.com
* updates: mirrors.greenmountainaccess.net
Installed Packages
neo4j-enterprise.noarch 2.2.5-1 @neo4j
9 changes: 9 additions & 0 deletions test/markup/shell/prompt-with-space.txt
@@ -0,0 +1,9 @@
[root@localhost ~]# yum list --show-duplicates neo4j-enterprise
Loaded plugins: fastestmirror, langpacks
Loading mirror speeds from cached hostfile
* base: mirror.cc.columbia.edu
* extras: mirror.es.its.nyu.edu
* rpmforge: repoforge.mirror.constant.com
* updates: mirrors.greenmountainaccess.net
Installed Packages
neo4j-enterprise.noarch 2.2.5-1 @neo4j
4 changes: 4 additions & 0 deletions test/markup/shell/prompt-with-tilde.expected.txt
@@ -0,0 +1,4 @@
<span class="hljs-meta">~/docs&gt;</span><span class="bash"> cat readme.adoc</span>
= Highlight.js

Highlight.js is a syntax highlighter written in JavaScript.
4 changes: 4 additions & 0 deletions test/markup/shell/prompt-with-tilde.txt
@@ -0,0 +1,4 @@
~/docs> cat readme.adoc
= Highlight.js

Highlight.js is a syntax highlighter written in JavaScript.

0 comments on commit 097acfc

Please sign in to comment.