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

HTML output looks incorrect #372

Closed
babakfp opened this issue Nov 4, 2022 · 7 comments
Closed

HTML output looks incorrect #372

babakfp opened this issue Nov 4, 2022 · 7 comments

Comments

@babakfp
Copy link

babakfp commented Nov 4, 2022

Hi

As you can see in this screenshot, the output looks incorrect because for example count++} shouldn't be inside only 1 element, the output should be count + + } instead (or something like that).

Screenshot 2022-11-04 140534

@babakfp
Copy link
Author

babakfp commented Dec 15, 2022

Screenshot 2022-12-15 061254

@muenzpraeger
Copy link
Collaborator

As the code examples above are no longer available just a guess: you're not loading the needed embedded languages for svelte. With that the tokenization can only use the svelte grammar, but not access the definitions from the the other languages that actually make svelte.

So load those languages, and you should be good. Eventually this would be solved automagically by PR #379.

For context:
When you inspect the tokenization in VS Code ("Developer: Inspect Editor Tokens and Scopes") you'll directly see from which (embedded) language it derives the tokenization. Like here the import keyword from JavaScript or the ++ increment from TypeScript.

image
image

@babakfp
Copy link
Author

babakfp commented Dec 16, 2022

Hi

Sorry, I updated the broken URLs. They should work now.

Your guess was correct, I added "typescript" and it fixed it👏.

Screenshot 2022-12-16 025510-min

the ++ increment from TypeScript.

image

Interesting, but why the language for ++ is typescript?🤨


There is still a bit of difference between vsCode and Shiki.

in vsCode:

Screenshot 2022-12-16 030207-min

(characters inside the red blocks look different in Shiki)


Thanks for the help🧡

@octref
Copy link
Collaborator

octref commented Jan 27, 2023

Seems identitcal to me now. If this is still an issue, open a new one.

@octref octref closed this as completed Jan 27, 2023
@octref
Copy link
Collaborator

octref commented Jan 27, 2023

image

@babakfp
Copy link
Author

babakfp commented Jan 27, 2023

@octref
I think the difference is because of this feature:
https://code.visualstudio.com/blogs/2021/09/29/bracket-pair-colorization
I'm not sure but I think we have an open issue (a feature request) related to this Bracket pair Colorization feature.

@octref
Copy link
Collaborator

octref commented Jan 27, 2023

#303

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants