I have this annoying behaviour with Eclipse where it warns me about the <main>
element in my JSP file.
I've got <!DOCTYPE html>
at the top of my page and I'm using several other HTML5 elements, such as <header>
and <footer>
, but Eclipse doesn't give a warning about these.
I tried switching off HTML and JSP syntax validation but that didn't seem to work.
I just don't understand why it has a problem with the <main>
tag but not other HTML5 tags and that little yellow underline is SUPER irritating.
How can I get Eclipse to ignore this tag?
Thank you in advance for your answers.
So, it seems like people were having a similar problem with HTML5 attributes according to the question linked in the comment @safin chacko.
The answers posted there show how you could get Eclipse to ignore validation of specified attributes. Since then it seems that Eclipse has the added feature of being able to also ignore validation of specified elements
I have posted an answer on that question which also answers my own question.
There appears to be a Bugzilla item for this already. Hopefully, when that is addressed, the problem will go away.
https://bugs.eclipse.org/bugs/show_bug.cgi?id=516758
In the meantime, you can suppress the warning by going to Eclipse > Preferences > Web > HTML Files > Validation and adding main to the comma-separated list element names to be ignored.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With