rouge-ruby / rouge

A pure Ruby code highlighter that is compatible with Pygments
https://rouge.jneen.net/
Other
3.3k stars 732 forks source link

Shell script lexer: Inline comment within inline command substitution affects up to the end of a line, beyond the end of the substitution #2013

Open Phroneris opened 6 months ago

Phroneris commented 6 months ago

Name of the lexer

Shell

Code sample

ls --all \
   -1 `# One file per line` \
   --group-directories-first

Additional context

The above shell script is identical to ls --all -1 --group-directories-first because the inline comment # ... remains in effect as a comment just until the end of the command substitution `...`.

But, Rouge currently treats the ` \ part at the end of the second line as comment contents too.