Skip to content

Commit

Permalink
Merge branch 'master' into toml-comment
Browse files Browse the repository at this point in the history
  • Loading branch information
marcoscaceres committed May 27, 2019
2 parents 30122a2 + d8808e9 commit d391717
Show file tree
Hide file tree
Showing 6 changed files with 9 additions and 1 deletion.
1 change: 1 addition & 0 deletions AUTHORS.en.txt
Original file line number Diff line number Diff line change
Expand Up @@ -276,3 +276,4 @@ Contributors:
- Sean T. Allen <sean@monkeysnatchbanana.com>
- Greg Cline <gregrcline@gmail.com>
- Sejin Jeon <jinaidy93@gmail.com>
- Taif Alimov <inzeppelin@gmail.com>
1 change: 1 addition & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ New languages:
New styles:

Improvements:
- Issue #1930 - fix markup for escaped quotes in Bash

## Version 9.15.6
New languages:
Expand Down
2 changes: 1 addition & 1 deletion src/languages/bash.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ function(hljs) {
};
var QUOTE_STRING = {
className: 'string',
begin: /"/, end: /"/,
begin: /(?<!\\)"/, end: /(?<!\\)"/,
contains: [
hljs.BACKSLASH_ESCAPE,
VAR,
Expand Down
2 changes: 2 additions & 0 deletions test/detect/bash/default.txt
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,5 @@ fi
genApacheConf(){
echo -e "# Host ${HOME_DIR}$1/$2 :"
}

echo '"quoted"' | tr -d \" > text.txt
2 changes: 2 additions & 0 deletions test/markup/bash/escaped-quote.expect.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
<span class="hljs-comment"># Escaped double-quote is not a string</span>
<span class="hljs-built_in">echo</span> <span class="hljs-string">'"quoted"'</span> | tr -d \" &gt; text.txt
2 changes: 2 additions & 0 deletions test/markup/bash/escaped-quote.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# Escaped double-quote is not a string
echo '"quoted"' | tr -d \" > text.txt

0 comments on commit d391717

Please sign in to comment.