Hacker News new | past | comments | ask | show | jobs | submit login

That's only a problem for XHTML. HTML5 implicitly closes the previous <p> tag when you open the next one; thus, a <p> inside a <p> is an implicit </p><p>, if you will.



Why does VS Code auto add the closing <p> tag when you open them then? It doesn’t do it for, say, <img>. Bug?


Feature. <p> tags can function as containers for text and other elements, and VS Code can't distinguish between <p>, with the special handling, and <div>, without it.

Okay, to be fair, that does sound like a bug.


Didn't know that. Thanks :)




Consider applying for YC's W25 batch! Applications are open till Nov 12.

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: