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

Consider adding more script types #110

Open
alexr00 opened this issue Jun 8, 2020 · 3 comments
Open

Consider adding more script types #110

alexr00 opened this issue Jun 8, 2020 · 3 comments

Comments

@alexr00
Copy link

alexr00 commented Jun 8, 2020

Originally from @xatian in microsoft/vscode#98507

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!

@nyehamene
Copy link

Hi, is there any progress on a solution for this issue. I have similar requirement to change the language type of a script tag to Java. Thanks.

@gwleuverink
Copy link

Looks like this issue is stale. Does anyone have any suggestions to do this any other way?

@dmnsgn
Copy link

dmnsgn commented May 2, 2023

Alternatively, should syntax highlighting default to JavaScript if the type is unknown?

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

4 participants