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

Syntax highlighting is absent in GitHub for .vue files with comment at top #5026

Open
matthew-white opened this issue Dec 5, 2024 · 1 comment

Comments

@matthew-white
Copy link

Vue - Official extension or vue-tsc version

N/A

VSCode version

N/A

Vue version

N/A

TypeScript version

N/A

System Info

No response

package.json dependencies

No response

Steps to reproduce

In a GitHub repository I work on, I noticed that as of the last week, .vue files no longer have syntax highlighting when viewed in GitHub. I think that syntax highlighting in GitHub is determined by github-linguist/linguist. They had a release last week (v9.0.0) that updated the Vue grammar to use the one in this repository instead of the one from vuejs/vue-syntax-highlight (PR: github-linguist/linguist#7086).

I think the issue has to do with comments in .vue files. In my repository, there is a file header with copyright information at the top of every file. The file header is in a comment above <template>. When I remove that comment, I see that there is syntax highlighting for the file in GitHub.

If linguist needs to use a different grammar file or do something different from what they're doing, I'd be happy to file an issue with them.

What is expected?

I should see syntax highlighting when I view a .vue file in GitHub.

What is actually happening?

I do not see syntax highlighting when a .vue file starts with a comment.

Link to minimal reproduction

https://gist.github.com/matthew-white/1ed66c54adfef4b5153cc9ed793f7529

Any additional comments?

No response

@FeBe95
Copy link

FeBe95 commented Dec 12, 2024

We are having the same issue with some files in our repo.

Same goes for bigger files: We have a component which contains almost 4000 lines of code (please don’t judge). Syntax highlighting is also completely absent in this file.

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

No branches or pull requests

2 participants