Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is it possible to add HTML5 validation to Visual Studio?

I'm working on a page using <canvas>, which is a HTML5 tag, in Visual Web Developer Express Edition 2008, and the validator in the HTML editor is telling me it's an invalid tag. That's because it's set to validate against XHTML 1.0 Transitional. I'd prefer for it to not do that and tell me what's valid or invalid based on the HTML5 doctype, but I can't find anywhere in the preferences that suggests this would be possible.

Is there a way to tell Visual Studio to validate against HTML5, or add a new spec reference manually? I'd prefer not to have to go in and add tags manually, which appears to be the only option at the moment.

like image 793
Rahul Avatar asked Jul 05 '09 14:07

Rahul


People also ask

How do I validate HTML in Visual Studio?

Follow the steps: Launch Visual Studio 2012. Go to Tools > Options menu. When Options configuration screen is displayed, go to Text Editor > HTML > Validation.

How do I add HTML5 to Visual Studio?

After installing SP1 you have to tell Visual Studio to start using the HTML5 schema. Go to Tools -> Options, and then select Text Editor -> HTML -> Validation. You should now be able to select HTML5 or XHTML5 as the target schema.

Does VS code support HTML5?

No, VS Code doesn't have built-in support for HTML preview but there are extensions available in the VS Code Marketplace.


2 Answers

It looks like the Visual Web Developer team solved the problem by adding HTML5 support themselves: http://blogs.msdn.com/webdevtools/archive/2009/11/18/html-5-intellisense-and-validation-schema-for-visual-studio-2008-and-visual-web-developer.aspx

You all probably know that new HTML 5 standard is coming. We made a new intellisense schema that you can add to VS 2008 or VWD Express 2008 and get intellisense and validation on HTML 5 elements.

like image 195
Rahul Avatar answered Sep 22 '22 05:09

Rahul


For Visual Studio 2010 you'll want to install the Web Standards Update for Visual Studio 2010 SP1:

It updates the HTML5 intellisense and validation to reflect the latest W3C specifications and fixes some bugs bugs in the current SP1 support for HTML5. Also JavaScript intellisense it updated to reflect many of the new browser capabilities such as Geolocation and DOM storage. Finally, this update adds comprehensive CSS3 intellisense and validation based on the latest specifications from W3C.

For Visual Studio 2008, Microsoft has provided an updated version of the HTML 5 validation schema and intellisense in the Visual Studio Gallery.

HTML 5 Intellisense

The updated schema was posted by Mikhail Arkhipov, the same Microsoft employee who wrote the blog post linked in Rahul's answer.

like image 22
Eric Bock Avatar answered Sep 22 '22 05:09

Eric Bock