diff --git a/AUTHORS.txt b/AUTHORS.txt index 1432d17ca0..68d7233d31 100644 --- a/AUTHORS.txt +++ b/AUTHORS.txt @@ -309,3 +309,4 @@ Contributors: - Patrick Scheibe - Kyle Brown - Marcus Ortiz +- Guillaume Grossetie diff --git a/CHANGES.md b/CHANGES.md index 564d2874c8..166481b633 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -12,6 +12,7 @@ New Languages: Language Improvements: +- enh(shell) Add support for multiline commands with line continuation `\` (#2861) [Guillaume Grossetie][] - bug(xml) XML grammar was far too imprecise/fuzzy [Josh Goebel][] - enh(xml) Improve precision to prevent false auto-detect positives [Josh Goebel][] - fix(js/ts) Prevent for/while/if/switch from falsly matching as functions (#2803) [Josh Goebel][] @@ -58,6 +59,7 @@ New themes: [Patrick Scheibe]: https://github.com/halirutan [Kyle Brown]: https://github.com/kylebrown9 [Marcus Ortiz]: https://github.com/mportiz08 +[Guillaume Grossetie]: https://github.com/mogztter ## Version 10.3.1 diff --git a/src/languages/shell.js b/src/languages/shell.js index 3a1bc033ad..aaf4ccb403 100644 --- a/src/languages/shell.js +++ b/src/languages/shell.js @@ -14,7 +14,7 @@ export default function(hljs) { className: 'meta', begin: '^\\s{0,3}[/\\w\\d\\[\\]()@-]*[>%$#]', starts: { - end: '$', subLanguage: 'bash' + end: '[^\\\\]\\s*$', subLanguage: 'bash' } } ] diff --git a/test/markup/shell/command-continuation.expect.txt b/test/markup/shell/command-continuation.expect.txt new file mode 100644 index 0000000000..276e6fe10a --- /dev/null +++ b/test/markup/shell/command-continuation.expect.txt @@ -0,0 +1,10 @@ +$ 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 + diff --git a/test/markup/shell/command-continuation.txt b/test/markup/shell/command-continuation.txt new file mode 100644 index 0000000000..b0befa2d13 --- /dev/null +++ b/test/markup/shell/command-continuation.txt @@ -0,0 +1,9 @@ +$ 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 diff --git a/test/markup/shell/plain-prompt.expect.txt b/test/markup/shell/plain-prompt.expect.txt index 5892a4c513..e9c27e7c64 100644 --- a/test/markup/shell/plain-prompt.expect.txt +++ b/test/markup/shell/plain-prompt.expect.txt @@ -1,2 +1,3 @@ > foo -> /bin/sh +> /bin/sh +