alexwforsythe / code-blocks

Syntax highlighting for Google Docs
https://www.alexwforsythe.com/code-blocks/
MIT License
698 stars 88 forks source link

Syntax highlighting for golang not quite right when using function signature to indicate function type #117

Closed saxon-milton closed 3 years ago

saxon-milton commented 4 years ago

I am finding that if I am using a function signature as a type e.g. var someFunc func(a int) error then the same colour will be used for lines after it. I have found that it's because there's no curly braces, so it thinks the function signature is continuing. If I add curly braces like this (which is not valid golang): var someFunc func(a int) error {} then it works.

alexwforsythe commented 3 years ago

From the README:

If you'd like to see Code Blocks update or fix support for an existing language:

  1. Check if the latest version of highlight.js already includes the update. If it does, submit a PR to this repository that bumps the highlight.js version in package.json.
  2. If highlight.js does not yet include the update, please submit an issue on their issue tracker.