Skip to content

The text "<script>" causes intellisense to disappear #596

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

Closed
davidcoats opened this issue Aug 23, 2022 · 1 comment · Fixed by #599
Closed

The text "<script>" causes intellisense to disappear #596

davidcoats opened this issue Aug 23, 2022 · 1 comment · Fixed by #599
Assignees

Comments

@davidcoats
Copy link

davidcoats commented Aug 23, 2022

What version of Tailwind CSS IntelliSense are you using?

v0.8.6

What version of Tailwind CSS are you using?

"tailwindcss": "3.1.8"

What package manager are you using?

npm

What operating system are you using?

Windows 10

Reproduction URL

No URL, but all that's needed is basic HTML:

<html>
<head>
<meta charset="utf-8" />
<title></title>
</head>
<body>
<!-- <script> -->
<div class="bg-green-500"></div>
<!-- </script> -->
<div class="bg-green-500"></div>
</body>
</html>

Describe your issue

If the text "<script>" appears in a file, all Tailwind CSS Intellisense functionality disappears until the text "</script>" appears.

Tailwind CSS Intellisense-Working

Tailwind CSS Intellisense-Not Working

Tailwind CSS Intellisense-Commented Out Script Tag

It might be a rare edge case, but was discovered when writing a blog post about <script> tags. In the HTML file for the post I have some code that makes the script tag easy to use (instead of typing &lt;script&gt;):

@{
var scriptTagHtml = @Html.Raw(Html.Encode("<script>"))
}
...

The @(scriptTagHtml) ...

But because the text "<script>" appears near the top of the file, all the Tailwind CSS Intellisense plugin stopped working for the rest of the file.

The work around is just to add the text "</script>" somewhere, perhaps in a commented out element. But that is a bit goofy.

I thought reporting this would be appreciated, and would be the least I could do thank you for all your great work on Tailwind CSS. I love it!

@davidcoats
Copy link
Author

Btw, I just found how to search closed issues. My issue seems similar to:

Intellisense is not working inside custom web component tags with style in the name, #542

And:
html style self closing tag break intellisense, #402

@bradlc bradlc self-assigned this Sep 1, 2022
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

Successfully merging a pull request may close this issue.

2 participants