rouge icon indicating copy to clipboard operation
rouge copied to clipboard

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

Open Phroneris opened this issue 2 years ago • 0 comments

Name of the lexer

Shell

Code sample

ls --all \
   -1 `# One file per line` \
   --group-directories-first
  • https://rouge.jneen.net/v4.2.0/shell/bHMgLS1hbGwgXAogICAtMSBgIyBPbmUgZmlsZSBwZXIgbGluZWAgXAogICAtLWdyb3VwLWRpcmVjdG9yaWVzLWZpcnN0

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.

Phroneris avatar Dec 09 '23 16:12 Phroneris