Zeyad Shaban
Zeyad Shaban

Reputation: 1016

Visual Studio code HTML Emmet is not formatted after I press tab

When I type div>label+input+button:submit{Submit} and press tab

Expected result:

<div>
    <label for=""></label>
    <input type="text">
    <button type="submit">Submit</button>
</div>

Result I get:

<div><label for=""></label><input type="text"><button type="submit">Submit</button></div>

How to fix this problem?

Video

Upvotes: 2

Views: 568

Answers (2)

JustBarnt
JustBarnt

Reputation: 124

Prettier will work but in your json file. you need to do

TLDR; You just need to replace javascript with the file type you are working in.

"[html]": {"editor.defaultFormatter":"esbenp.prettier-vscode"}

For example I use emmet with razor components. so my json file has this

"[razor]": {"editor.defaultFormatter":"esbenp.prettier-vscode"}

Upvotes: 1

Mohammad Mohammadi
Mohammad Mohammadi

Reputation: 305

use Prettier - Code formatter.

Upvotes: 1

Related Questions