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

change the code-language of tag-content in html files #98507

Closed
xatian opened this issue May 25, 2020 · 4 comments
Closed

change the code-language of tag-content in html files #98507

xatian opened this issue May 25, 2020 · 4 comments
Assignees
Labels
grammar Syntax highlighting grammar upstream-issue-linked This is an upstream issue that has been reported upstream

Comments

@xatian
Copy link

xatian commented May 25, 2020

If I open an html-file in VS-code I get nice syntax-highlighting since the content is treated as HTML. But depending on tags the language used inside the tag to highlight the code is changed.

<p>This is treated as HTML</p>
<script>
    Everything inside this tag is treated as Javascript.
</script>
<style>
    Everything inside this tag is treated as CSS.
</style>
<script type="unknown">
    Everything inside this tag is treated as HTML.
</script>
<script type="module">
    Everything inside this tag is treated as Javascript.
</script>

Is it possible to register a custom tag tied to a language?

What I actually want is <script type="text/typescript"> that changes the language inside to Typescript. If that is not possible I would also settle for a <typescript> tag since my "build-process" will process this node anyways. Maybe that is already possible somehow?
If not please add it.
Thank you!

@vscodebot
Copy link

vscodebot bot commented May 25, 2020

(Experimental duplicate detection)
Thanks for submitting this issue. Please also check if it is already covered by an existing one, like:

@aeschli
Copy link
Contributor

aeschli commented May 26, 2020

The syntax highlighting comes from the HTML textmate grammar. The new types need to be added there.

@alexr00
Copy link
Member

alexr00 commented Jun 8, 2020

Moved to owning repo: textmate/html.tmbundle#110

@alexr00 alexr00 added grammar Syntax highlighting grammar upstream-issue-linked This is an upstream issue that has been reported upstream labels Jun 8, 2020
@alexr00
Copy link
Member

alexr00 commented Nov 5, 2020

Closing in favor of the upstream issue.

@alexr00 alexr00 closed this as completed Nov 5, 2020
@github-actions github-actions bot locked and limited conversation to collaborators Dec 21, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
grammar Syntax highlighting grammar upstream-issue-linked This is an upstream issue that has been reported upstream
Projects
None yet
Development

No branches or pull requests

3 participants