You can see that github's highlighter gets it right, but hljs wraps everything following # in a comment span:
<span class="hljs-comment">#qwert</span>
This is incorrect according to POSIX 2.3 "Token Recognition" (see rules 8 and 9 in particular), and from my testing sh, bash and zsh are consistent with this.
Expected behavior
If there is no space or start-of-line in front of a #, it should not start a comment span.
Additional context
I'm working on a fix for this myself right now, will submit a PR in a bit.
EDIT: PR is ready, see link below.
Describe the issue
Which language seems to have the issue? bash
Sample Code to Reproduce
You can see that github's highlighter gets it right, but hljs wraps everything following
#
in a comment span:This is incorrect according to POSIX 2.3 "Token Recognition" (see rules 8 and 9 in particular), and from my testing sh, bash and zsh are consistent with this.
Expected behavior If there is no space or start-of-line in front of a
#
, it should not start a comment span.Additional context I'm working on a fix for this myself right now, will submit a PR in a bit. EDIT: PR is ready, see link below.