Skip to content

HTML Formatter removes content of script tag #39706

@ezra100

Description

@ezra100
  • VSCode Version: 1.18.1
  • OS Version: Windows 10

Steps to Reproduce:

  1. Open a new file and change the language to HTML.
  2. Insert the following code (Make sure that you leave a space between the script opening and closing tags):
<!DOCTYPE html>
<html lang="en">
    <head>
        <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.2.1/jquery.min.js"> </script>
    </head>
</html>
  1. Format code (Ctrl+Alt+F)

What should happen:
The code should be formatted without changing the content.

What actually happens:
The code is formatted but the opening script tag and its content is removed. Final results is:

<!DOCTYPE html>
<html lang="en">

<head>
    </script>
</head>

</html>

Reproduces without extensions: The formatter seems to be a part of an extension that comes with VSCode, so with the extensions disabled Ctrl+Alt+F does nothing.

Metadata

Metadata

Assignees

Labels

htmlHTML support issues

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions