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

No syntax highlighting within <style> tag #135

Open
DCRichards opened this issue May 14, 2019 · 8 comments
Open

No syntax highlighting within <style> tag #135

DCRichards opened this issue May 14, 2019 · 8 comments

Comments

@DCRichards
Copy link

Vim version: VIM - Vi IMproved 8.1 (2018 May 18, compiled Apr 11 2019 17:46:54)
Plugin version: ?

Issue

I currently have no syntax highlighting being shown within the <style> tags of my vue file, the filetype is set correctly and HTML and JS are highlighted correctly but SCSS highlighting is currently missing. I have tried syntax sync fromstart and changing scoped and lang="" to various values and nothing seems to change this. Is there something within the SCSS itself causing this?

Screenshot 2019-05-14 at 11 38 43

@DCRichards DCRichards changed the title no syntax highlighting within <style> tag No syntax highlighting within <style> tag May 14, 2019
@ctstewart
Copy link

I am also having this issue. If you remove everything from the <style> tag, then it highlights as expected, but this is not an ideal solution.

@lauraxm
Copy link

lauraxm commented Jun 5, 2019

Same here :( tried to figure out if I had something else messing it up but I'm still stuck.

@ladevieq
Copy link

I got the same issue, but syntax highlight works correctly within <style lang="less"> tag.

@askamiroff
Copy link

askamiroff commented Aug 29, 2019

something with </b>:
before: https://i.imgur.com/PT9C4G7.png
after: https://i.imgur.com/bGtCDyW.png

This tags causing errors in my case, when im adding "-" in <b-tag>:
https://i.imgur.com/X4y8sff.png

updated
so, short and simple fix, add to your .vimrc

let html_no_rendering=1

https://i.imgur.com/DQzaOnx.png

@estan
Copy link

estan commented Oct 26, 2019

Having this problem as well. For some files it works and for some it does not.

E.g. in a from-scratch vue-cli project, the CSS in App.vue (left) is highlighted correctly, but the CSS in components/HelloWorld.vue (right) is not:

app-and-hello-world-component

EDIT: The let html_no_rendering=1 workaround suggested by @askamiroff above worked, but not sure what other consequences it has.

@DCRichards
Copy link
Author

@estan this might be due to your separated tags, the </a and >. If you place them on the same line does it still happen?

Having this problem as well. For some files it works and for some it does not.

E.g. in a from-scratch vue-cli project, the CSS in App.vue (left) is highlighted correctly, but the CSS in components/HelloWorld.vue (right) is not:

app-and-hello-world-component

EDIT: The let html_no_rendering=1 workaround suggested by @askamiroff above worked, but not sure what other consequences it has.

@regzon
Copy link

regzon commented May 11, 2020

It looks like this is an issue in the default HTML syntax highlighting. I've installed othree/html5.vim plugin and now it works pretty well.

@harrywhite4
Copy link

harrywhite4 commented May 27, 2020

This seems to only happen when you have self closed tags that render text within them differently (like <i> and <b>) as the closing tag isn't found.
The html_no_rendering option just turns that rendering off as mentioned in :h html.vim.

Could probably fix it while keeping the rendering by changing how these regions are defined https://github.com/vim/vim/blob/master/runtime/syntax/html.vim#L159

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

8 participants