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

Invalid syntax highlighing of <!----------blablabla-----------> in .html file #33944

Closed
luqimin opened this issue Sep 7, 2017 · 5 comments
Closed
Assignees
Labels
html HTML support issues

Comments

@luqimin
Copy link

luqimin commented Sep 7, 2017

as mentioned in the title..

@vscodebot vscodebot bot added the html HTML support issues label Sep 7, 2017
@roblourens
Copy link
Member

I see that it messes up colorization. Not sure if it's invalid or what:

image

@iMahesh
Copy link

iMahesh commented Sep 7, 2017

@luqimin if you a leave space on both sides of --------blablabla--------- just like <!-- --------blablabla--------- --> instead of <!----------blablabla-----------> it works perfectly well(It's a best practice as well).
It'll also work if you add one more - on the right-hand side of the blablabla, just in case if you don't want to leave any space in-between.

I wouldn't recommend typing <!-- --> manually to comment lines. better to use Ctrl+/ to avoid any DOM rendering issues.

SOURCE

@yume-chan
Copy link
Contributor

yume-chan commented Sep 8, 2017

Multiple hyphens in comments are valid in HTML5 standard:

8.1.6. Comments

Comments must have the following format:

  1. The string "<!--"
  2. Optionally, text, with the additional restriction that the text must not start with the string ">", nor start with the string "->", nor contain the strings "<!--", "-->", or "--!>", nor end with the string "<!-".
  3. The string "-->"

In fact, according to the parsing rules, <! >, <!-- <!-- --> and <!-- --!> are parse errors but recoverable and also represents HTML comments.

Of course, they are invalid in XML standard, but HTML is not XML.

@aeschli aeschli changed the title vscode doesn't recognise this kind of comment: <!----------blablabla-----------> in .html file Invalid syntax highlighing of <!----------blablabla-----------> in .html file Sep 8, 2017
@aeschli
Copy link
Contributor

aeschli commented Sep 8, 2017

This issue was moved to textmate/html.tmbundle#75

@aeschli aeschli closed this as completed Sep 8, 2017
@vscodebot vscodebot bot locked and limited conversation to collaborators Nov 17, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
html HTML support issues
Projects
None yet
Development

No branches or pull requests

6 participants