From Cursor 3.10.10 and up, HTML "Format Document" no longer formats with embedded JavaScript and CSS blocks

Where does the bug appear (feature/product)?

Cursor IDE

Describe the Bug

HTML Format Document no longer formats with embedded JavaScript and CSS blocks.
Since Cursor 3.10.10

Example:
< !doctype html >
< html >
< body >

< script >
function test() {
console.log(“hello”);
}
< /script >

< style >
.foo {
color:red;
}
< /style >

< /body >
< /html >

Expected:
The formatter should indent JS and CSS inside the HTML tags.

Actual:
Format Document does nothing for embedded < script > and < style > content.
Note: a HTML file without embedded script or style tag does format, so do separate JS files or CSS files

Regression:
Working:

  • Cursor 3.9.16
  • Cursor 3.9.8
  • Cursor 3.7.19
  • Cursor 3.6.21

Broken:

  • Cursor 3.10.10
  • Cursor 3.10.11
  • Cursor 3.10.17

The latest VS Code and Windsurf still format the same file correctly.

Steps to Reproduce

Create a rudimentary HTML file (make sure language mode is on HTML)
Insert a script tag with a simple js piece and do the same for a style tag (see example html above).

Now right click in the document and choose “Format Document”

Nothing happens

Expected Behavior

The formatter should indent JS and CSS inside the HTML tags.

Operating System

Windows 10/11

Version Information

Still Works:
Version: 3.9.16 (system setup)
VS Code Extension API: 1.105.1
Commit: 042b3c1a4c53f2c3808067f519fbfc67b72cad80
Date: 2026-06-27T06:41:01.941Z
Layout: editor
Build Type: Stable
Release Track: Default
Electron: 40.10.3
Chromium: 144.0.7559.236
Node.js: 24.15.0
V8: 14.4.258.32-electron.0
xterm.js: 6.1.0-beta.256
OS: Windows_NT x64 10.0.26200

Doesnt work:
3.10.10 and up

For AI issues: which model did you use?

NA

Does this stop you from using Cursor

No - Cursor works, but with this issue

Hi @stefan_l Thanks for the post! I’ve raised a bug report for this

This is a genuine regression on our side introduced in 3.10, not your setup. A packaging change in 3.10 stops the built-in HTML formatter from handling embedded <script> blocks, and because Format Document applies one combined change to the whole file, the <style> and surrounding HTML end up untouched too. Files with no embedded script/style still format, which is why VS Code and Windsurf (which don’t ship this change) are unaffected. We have logged it and are working on a fix.

A workaround in the meantime:

Use Prettier as your HTML formatter. Install the Prettier extension and add this to settings.json:

"editor.defaultFormatter": "esbenp.prettier-vscode"

Prettier formats the HTML along with the embedded JavaScript and CSS. You can also right-click and choose Format Document With… to pick it per file. I will follow up with any updates onthis.

@stefan_l Good news! We’ve merged a fix for this. It will likely land in a release early next week.

Hi @kevinn thank you for the swift reply and the good news!
I might setup prettier, or wait for the fix if it will be there that soon :slight_smile: :+1:

We released it to nightly (3.10.21) so if you want it early you can go to Cursor Settings → Beta → And Choose Update Access Nightly, and then update and Restart Cursor :smiley: