1

I am using React to build a front end, using the create-react-app package to generate a boilerplate. When going into any js file that has embedded HTML, when I save, the HTML goes all askew, everything compiles correctly, but the formatting looks horribly off. The image below shows how my code looks after save...

enter image description here

I know I could go to my settings and set

"editor.formatOnSave": true

However, I lose formatting on saving on all other files, which I would prefer to have.

Are there any extensions/settings so that when I save a js file with embedded HTML that it formats the HTML code?

2
  • 1
    Check the same issue here – stackoverflow.com/questions/44993808/… Commented Sep 4, 2017 at 20:33
  • @chuve Yes, it was an installed formatting extension Beautify causing this, noticed just before you posted your comment Commented Sep 4, 2017 at 20:35

1 Answer 1

1

I found the cause of this for anyone that may come across it.

The extension Beautify was causing the code for format incorrectly.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.