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’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Haskell syntax highlighting correctly after quote in char '"' (ES6 modules) #3786

Closed
j-erasmus opened this issue May 12, 2023 · 4 comments
Closed
Labels
bug help welcome Could use help from community language

Comments

@j-erasmus
Copy link

Describe the issue
Haskell syntax highlighting is not always highlighting as expected.

I have a construction of char " which is '"' in haskell. But highlighter thinks it's the start of a string. (But it isn't).

Which language seems to have the issue?
Haskell

Are you using highlight or highlightAuto?

hljs.highlightAll();

Sample Code to Reproduce

Codepen

(ES6 modules)

Screenshot 2023-05-12 at 11 48 12

Screenshot 2023-05-12 at 11 55 25

Expected behavior

-- some comment should be treated as a comment, etc.

(CommonJS via CDN)

Screenshot 2023-05-12 at 11 54 24

Screenshot 2023-05-12 at 11 55 55

Additional context

I used ES6 modules to reproduce the bug, everything seems to work correctly when using CommonJS via CDN.

@j-erasmus j-erasmus added bug help welcome Could use help from community language labels May 12, 2023
@joshgoebel
Copy link
Member

The syntax highlighting in both those examples is way different. I'd guess you're ES6 example isn't loading Haskell and isn't actually using the Haskell grammar at all but rather some other grammar - that is resulting in the entirely different highlighting.

@j-erasmus
Copy link
Author

I'd guess you're ES6 example isn't loading Haskell

In this example I'm loading Haskell from the CDN but highlighting still seems to break after the '"'. If I remove '"' from the Haskell code in that example the highlighting works as expected.

@joshgoebel
Copy link
Member

Screen Shot 2023-05-18 at 6 00 08 PM

Looks correct If you bump to 11.8 vs 11.7.

@j-erasmus
Copy link
Author

Thanks @joshgoebel, I can confirm upgrading to 11.8 fixes the issue 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug help welcome Could use help from community language
Projects
None yet
Development

No branches or pull requests

2 participants