tommasongr / nova-vue

Vue support for Nova editor.
MIT License
37 stars 7 forks source link

Highlighting fails on hyphenated tags #31

Closed command-tab closed 3 years ago

command-tab commented 3 years ago

Thank you for building this Nova extension! ❤️ I ran into this little bug today...

In places where DOM templates use kebab-case, nova-vue fails to highlight hyphenated tags:

image

Notice that nuxt-link highlighting stops highlighting the Vue tag (styled green by my theme) at nuxt- but doesn't include link. Could the match pattern for tags be updated to include hyphens? Or is that out of scope of this extension, and something that's better suited to the Nova HTML highlighter?

Thanks!

tommasongr commented 3 years ago

Hi there! Thanks for enjoying Nova Vue 😄

I'm sorry for the issue... Yesterday I pushed an update but I haven't touched the syntax highlighting. Have you ever encountered this problem with the prior versions?

Anyway I'll look at it as soon as possible. Can you tell me what theme are you using? Maybe it's a problem of how the Vue special highlighting is implemented in the theme.

Thanks

command-tab commented 3 years ago

Thanks for the fast reply!

I did encounter the issue before the 4.1 release. Yesterday I updated to 4.1 hoping it would fix it, but it made no change.

I'm using my own custom editor theme with my preferred colors, but this particular highlighting issue persists no matter what Nova editor theme I switch to; I see the same issue just in different colors. Here it is in the Dark theme that ships with Nova:

image

I suppose this is a good reason for me to switch to using PascalCase for Vue component names 🤔

tommasongr commented 3 years ago

No unfortunately 4.1 was focused on Language Server and JS related stuff.

Thanks for the explanation, I'll look at the default Dark theme and let you know.

No don't worry, we'll fix it. Kebab-case feels way better to me ahahah

tommasongr commented 3 years ago

Hi again! That has been an easy one! I just pushed v4.2 that solves the issue.

Just to be sure, did you experienced this issue with other tags too? I ask because the extension treats some tags like nuxt-link as special ones. In fact, the problem was that I missed to specify the kabab-case version of NuxtLink.

Here is the list of all the special tags. If you think I missed something let me know 😄

CleanShot 2021-05-03 at 19 24 21@2x
command-tab commented 3 years ago

Ah, you're right, it looks like nuxt-link is the only one. Other hyphenated tags are highlighted as plain HTML tags. 🙌🏻 4.2 fixes nuxt-link. Thank you!!

tommasongr commented 3 years ago

You are welcome!