Linguist: Shell: Incorrect syntax highlighting for command substitution using backticks with comment inside

Created on 2 Sep 2016  路  8Comments  路  Source: github/linguist

All these would output (foo)()(bar), which is not what the syntax highlighting implies:

printf '(%s)' foo "`# '`" bar
printf '(%s)' foo "`# "`" bar
printf '(%s)' foo "`# '`" \
  bar
printf '(%s)' foo "`# "`" \
  bar

Most helpful comment

We could add a README.md file to the vendor/ directory that lists what each language uses for syntax highlighting. Something like this, perhaps:

Obviously, this wouldn't be updated by hand: it'd be done automatically whenever bundle exec rake whatever is called.

All 8 comments

Syntax highlighting on GitHub is provided by TextMate-compatible grammars, which Linguist selects to provide code colouring. For shell-scripts, the highlighting is provided by atom/language-shellscript. You should report this issue there.

Oh, OK. It was https://help.github.com/articles/creating-and-highlighting-code-blocks/ (_"We use Linguist to perform language detection and syntax highlighting."_) that lead me here.

It was https://help.github.com/articles/creating-and-highlighting-code-blocks/ ("We use Linguist to perform language detection and syntax highlighting.") that lead me here.

@arfon Maybe this could be slightly rephrased to explain that Linguist only _selects_ the grammars for syntax highlighting? I'm not sure what's the best way to redirect users to those grammars though :/

@arfon Maybe this could be slightly rephrased to explain that Linguist only selects the grammars for syntax highlighting?

Yeah, that's probably worth updating to make things a little clearer.

I'm not sure what's the best way to redirect users to those grammars though :/

I mean, this list is the source of truth here but the idea of sending people to a folder of Git submodules is literally the least user-friendly thing I think I've ever thought of...

We could add a README.md file to the vendor/ directory that lists what each language uses for syntax highlighting. Something like this, perhaps:

Obviously, this wouldn't be updated by hand: it'd be done automatically whenever bundle exec rake whatever is called.

Obviously, this wouldn't be updated by hand: it'd be done automatically whenever bundle exec rake whatever is called.

馃憤 love it.

I'll have a crack at it then. =) Will give me an excuse to brush up on my Ruby skills. Which're currently so rusty, I installed cargo instead of gem.

That might very well be the funniest thing I'll say, ever.

EDIT: For those who don't get it.

Righto, actioned. This is the first serious Ruby script I've ever written, so go easy on me, heh.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

etc0de picture etc0de  路  5Comments

arfon picture arfon  路  6Comments

RafaelPAndrade picture RafaelPAndrade  路  4Comments

Sanchez3 picture Sanchez3  路  4Comments

oldmud0 picture oldmud0  路  6Comments