github-linguist / github-linguist/linguist

Shell: Combining here string & line continuation breaks bash highlighting

Open
#6,768 1 comment 0 reactions 0 assignees View on GitHub
Syntax 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

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.