Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

No syntax highlighting for multiple line comments #1732

Open
victorhuangwq opened this issue Jan 29, 2023 · 4 comments 路 May be fixed by #2150
Open

No syntax highlighting for multiple line comments #1732

victorhuangwq opened this issue Jan 29, 2023 · 4 comments 路 May be fixed by #2150

Comments

@victorhuangwq
Copy link
Contributor

The comment on lines 2 and 3 is black instead of green

Issue has been around for a while (including on prod!) but for some reason no one quite attended to it

Incorrect syntax highlighting physically hurts my eyes 馃槩 - Oliver

Image

@damianhxy
Copy link
Member

Unfortunately, updating to the last version of highlight.js (v11.7.0) doesn't seem to fix it.

Style does change slightly though:
Screenshot 2023-01-30 at 14 47 45

@damianhxy
Copy link
Member

On second thoughts, it's probably because of this code in annotations.js

    // Add syntax highlighting to the new code viewer
    $('pre code').each(function () {
      hljs.highlightBlock(this);
    });

I think oliver had a wip branch speedgrader-syntax-fix, it might be worth further investigation

@victorhuangwq
Copy link
Contributor Author

It's mainly because the syntax highlighting is done line by line instead of the whole file

@damianhxy
Copy link
Member

Could consider using https://github.com/wcoder/highlightjs-line-numbers.js

@KesterTan KesterTan linked a pull request Apr 22, 2024 that will close this issue
6 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants