github-linguist / github-linguist/linguist
Shell: Combining here string & line continuation breaks bash highlighting
- Dominant language
- Ruby
- Stars
- 13.7k
- Forks
- 5.4k
- Avg merge
- 1d 15h
- Merged PRs (30d)
- 17
Description
## Describe the bug
Bash script highlighting completely breaks for the rest of the file if you use a here string in combination with line continuation:
```shell
#!/usr/bin/env bash
# this works (here string)
ssh \
"foo@bar" \
"/usr/bin/bash" -sl <<< 'echo "test"'
# this doesn't (here string + line continuation)
ssh \
"foo@bar" \
"/usr/bin/bash" -sl <<< \
'echo "test"'
echo 'now highlighting is completely broken and does not recover for the rest of the file'
```
### Expected behaviour
Here string syntax is recognized and highlighted correctly even when followed by a line continuation.
### Additional notes
I read the comment in https://github.com/github-linguist/linguist/blob/master/vendor/README.md, but it's impossible to report this bug in the grammar upstream, since that repository is now archived and unmaintained: https://github.com/atom/language-shellscript
Contributor guide
Assessment
This issue has not been assessed yet.