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

custom 'html' tags are in red color #92

Closed
aeschli opened this issue Aug 16, 2018 · 16 comments
Closed

custom 'html' tags are in red color #92

aeschli opened this issue Aug 16, 2018 · 16 comments

Comments

@aeschli
Copy link
Contributor

aeschli commented Aug 16, 2018

From @VladimirAmiorkov on August 15, 2018 12:24

  • VSCode Version: 1.26.0 (1.26.0)
  • OS Version: macOS High Sierra 10.13.6 (17G65)

Steps to Reproduce:

  1. Download [this](url
    https://github.com/telerik/nativescript-ui-samples-angular/blob/master/listview/app/examples/getting-started/listview-getting-started.component.html) html file or create one with "invalid" html tags
  2. Open it in the latest version of Vs Code
  3. The GridLayout, RadListView and StackLayout are coloured bright red as shown in the screenshot bellow

screen shot 2018-08-15 at 15 25 01

Does this issue occur when all extensions are disabled?: Yes

I see that this is probably an new feature that has been added to show "invalid" html tags as red but in our realm we are developing NativeScript with Angular which includes the creation of our custom html tags which are not part of the standard html tags. Can this be disabled or changed in any way, those tag where not coloured in bright red in the previous version, only in 1.26.0.

Copied from original issue: microsoft/vscode#56467

@aeschli
Copy link
Contributor Author

aeschli commented Aug 16, 2018

The coloring of 'invalid' elements makes the grammar very hard to use for HTML-derivatives. I'd vote to remove that enhancement again.

@EmandM
Copy link

EmandM commented Sep 4, 2018

It would be nice to at least have a setting to turn this off, it makes development a lot harder than is necessary.

@darkyelox
Copy link

It's very annoying see those tags in red color in my NativeScript templates

@Redsmith24
Copy link

Can anybody please remove this enhancement or can anybody tell me how to remove by myself? Can I edit a specific file in the bundle to remove this?

@jnorkus
Copy link

jnorkus commented Sep 27, 2018

This "feature" is a pain to my eyes! Please add a setting.

@infininight
Copy link
Member

So what I'm looking at doing to correct this is to add a secondary grammar called "HTML (Derivative)" which allows for any tag name. This maintains the integrity of the proper HTML grammar while allowing for template cases where the tag rules are relaxed.

@infininight
Copy link
Member

This has now been added. The new grammar is exactly the same as the HTML grammar but with the removal of the invalid tag handling. The new tag scoping is retained with a new scope for all tags that would not be valid in a pure HTML context.

Unsure if this will get picked up automatically in the next VSCode release or if it will need special handling perhaps @aeschli can talk to that part.

karlhorky added a commit to karlhorky/vscode-markdown-tm-grammar that referenced this issue Aug 18, 2019
Instead of requiring a name to match an existing HTML element, this relaxes the
restrictions to:

- starting with [a-zA-Z] (matching the HTML parser WICG/webcomponents#239 (comment))
- then continuing with anything other than a space, forward slash or closing
  angle bracket

This is similar to the fix to the following issue in the HTML syntax
highlighting repo (and actually depends on the "derivative" syntax that was
created for that issue):

textmate/html.tmbundle#92
@AndreVanKammen
Copy link

is still red, i had to read through 3 closed tickets to get to somewhere I can post that because the original was closed: https://github.com/microsoft/vscode/issues/59947 Thanks for wasting a lot of my time to find stuff like this because issues is getting real messy. It won't take long before people just stop bothering to report this stuff.

And center is not an invalid tag, just obsolete. But it's just easier to use than adding a style to a div that does the same so it will never go away

@LinuxLikeUnix
Copy link

LinuxLikeUnix commented Jun 3, 2022

Was this ever fixed three years ago?

My <center> tags are still red.

@M-Valentino
Copy link

My center tags are still red too.

@UKhira
Copy link

UKhira commented Apr 30, 2023

I had to face this issue with <center> tag today. Thought it was syntax error at first. then I recheck, googled and does everything as possible to make it correct. then finally met up with this thumbnail.

This really is an eyesore.

@GadoGadoEnjoyer
Copy link

so,,,, any fixing yet?

@programORdie2
Copy link

Stil red...

@Pyonchi
Copy link

Pyonchi commented Mar 8, 2024

<center> tag is still red.

@programORdie2
Copy link

It's because the <center> tag is deprecated.
See: https://developer.mozilla.org/en-US/docs/Web/HTML/Element/center

@Pyonchi
Copy link

Pyonchi commented Mar 10, 2024

It's because the <center> tag is deprecated. See: https://developer.mozilla.org/en-US/docs/Web/HTML/Element/center

Oh, thanks for pointing it out, I didn't know about this. I'm still fairly new to HTML/CSS as a whole.

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