In an HTML5 document (<!DOCTYPE html>), if I type <br> the Visual Studio.Net auto-completion stuff “helpfully” changes it to <br /> when I type the closing >. I’ve looked in the options for the HTML designer, and don’t see anything about changing that, nor do I see any options at the project level. Is there a way?
Granted, <br /> is valid HTML5, but it’s not what I want — and even if I change my doctype to HTML4 (where <br /> isn’t valid although browsers are smart about allowing it), the environment does the same thing. So I’m thinking it’s not working from the doctype, but from some other setting I haven’t found.
I’m using VS.Net 2008, some other team members are still back on VS.Net 2005.
I found it: You right-click the document and choose Formatting and validation… That takes you to the options under Text Editor | HTML | Format (you could also get their via Options, of course). There are some general options there, though nothing like simply choosing your target markup. But you can click a Tag-specific options… button to customize each tag individually. (In my case, it didn’t even list the
brtag but I was able to add it and tell it not to make it a self-closing tag.)