Html script closing-tag not detected when occurs immediately after 2 slashes
See original GitHub issueHi, I found a bug, with the html grammar in VS Code, when you place a closing script-tag in the same line immediately after 2 fwd slashes, as:
<script> //</script>
the grammar will not detect the closing tag, and will display it with wrong color, see images.
(I’m not sure if the issue is related only to vscode-textmate, or it belongs to textmate/html.tmbundle).
VS Code:
Visual Studio 2015:
- VSCode Version: Code 1.13.1 (379d2efb5539b09112c793d3d9a413017d736f89, 2017-06-14T18:21:47.485Z)
- OS Version: Windows_NT ia32 10.0.15063
Steps to Reproduce:
- Open any html document with VSCode.
- Insert a script element in the document, and place the script’s closing-tag immediately after 2 fwd slashes.
Issue Analytics
- State:
- Created 6 years ago
- Comments:15 (8 by maintainers)
Top Results From Across the Web
Why don't self-closing script elements work? - Stack Overflow
And in plain HTML, the self-closing syntax is not supported. The trailing slash is just ignored, you have to use an explicit closing...
Read more >Closing an HTML element without using literal slashes?
The problem is that the <script> tag can't be closed because the filename can't contain a / . This means that the script...
Read more >Invalid XHTML: missing trailing slashes, absolute urls ... - Drupal
So far I've found that var $content = $('<div>' + content + '</div>'); // No .outerHTML() in jQuery :( is where the self...
Read more >To slash or not to slash | Google Search Central Blog
Historically, it's common for URLs with a trailing slash to indicate a directory, and those without a trailing slash to denote a file:....
Read more >XSS Filter Evasion - OWASP Cheat Sheet Series
The following is a "polygot test XSS payload." This test will execute in multiple contexts including html, script string, js and URL.
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
I think this is not a vscode-textmate issue. The problem here is that the html grammar includes
source.js
which is HTML agnostic and “eats up” all characters of a line comment to the end of the line for example. IMHO we would need to have a specialsource.html-embedded.js
or something which is always looking for</script>
. AFAIK there are no other workarounds for an embedded TM grammar.Thank you @msftrncs , this issue is also fixed by #85