Skip to content

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

Closed
@matthew-white

Description

@matthew-white

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions