Skip to main content

Posts

Showing posts from 2017

Validate HTML as XHTML in Intelij

When working in intelij with HTML, sometimes we need to make sure our HTML is XHTML compliance, no un ened tags etc.
i.e. we should not have

<img src="myimage.jpg> If You put above code in an HTML and run it in browser it will work fine, but if you are using some server side framework like Thymeleaf with Spring, it will generate error saying <img> tag must be terminated.

By Default intelij will not complaint about this and when you are writing HTML you may ignore the error and will get the error when you actually run it with in server. Or worst some HTML developer is writing the code HTML code for you and then you will have to fix all these errors.

Intelij can help you to make sure you write a valid HTML(XHTML). You can enable XHTML validation for HTML files by following below steps.

Go to Settings(Windows)/Preference(mac) in Intelij.Search for "File Types"Find HTML as shown in image below. You will see HTML has some extension associated with like *.html, *…