microsoft / microsoft/TypeScript-TmLanguage

HTML comments are not considered comments

Open
#781 2 comments 2 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Suggestion
Dominant language
TypeScript
Stars
471
Forks
149
PR merge metrics
No merged PRs in 30d

Description

In JavaScript, HTML comments are a valid replacement for single line comments.
They are considered comments in Node.js, inline script tags, external js file, etc.

<!-- No comment.
// Comment.

Even GitHub doesn't seem to understand this syntax 🤔

Your grammar does not seem to support them, and mistakes them as a syntax error.

Link to the relevant part of the spec

In the spec this syntax appears under additional syntax for web browsers, yet you do support the other additional syntax in that section, such as legacy octal numeric literals and octal string escapes, but not HTML comments.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by locating the TypeScript TextMate grammar rules for JavaScript comments and compare them with the ECMAScript HTML-like comments section linked in the issue. Verify the grammar against the shown HTML-comment example and confirm that it is no longer reported as a syntax error.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript, typescript
Domain
tooling
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
38/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.