Turning off HTML validation. I mean it.
I want to turn every facet of HTML validation, period. Due to the dynamic, generated nature of my JSP pages, such validations are most often than not just an inventive way to paint my right gutter in yellow. All I want from IDEA regarding HTML is highlighting, and thankfully it's good enough at that.
So, how can I accomplish this? I've already unchecked the "Required HTML attributes", "Unknown HTML attributes" and "Unknown HTML tags" inspections, but IDEA still complain about tags being on the wrong place ("XX tag is now allowed here").
BTW, the Errors configuration dialog needs some serious reorganization before release. Options related to JSP/HTML/JavaScript should be grouped together.
Please sign in to leave a comment.
I have exactly the same problem. Now it is possible to use jsps, but its unthinkable that we should set html validation off by hand page by page.
Please, post jsp fragment to produce error 'tags being on the wrong
place ("XX tag is now allowed here")'
Marcus Brito wrote:
--
Best regards,
Maxim Mossienko
IntelliJ Labs / JetBrains Inc.
http://www.intellij.com
"Develop with pleasure!"
All we want is a global "turn html validation off"; and (again) examples where it just can't work there are (countably) inifinitely many, i.e. just when part of the html is java generated.
Maxim, there's nothing wrong about the validation per se: the messages would be correct, if I'd bother to validate my pages as HTML. Truth is, I don't. Most of my JSP pages only vaguely resemble HTML, much less valid HTML.
Anyway, just to give up an example about what I'm talking about:
On the code sample above, IDEA will complain about <tr> not being allowed there -- probable because there isn't a surrounding <table> tag. IDEA has no idea (no pun intended) that the surrounding ]]> tag will be generated by the <page:apply-decorator/> tag.
Bottom line: My JSP pages will never get even close to being valid HTML, and I don't want IDEA to validate them as such.
This thread is similar to:
http://intellij.net/forums/thread.jsp?forum=22&thread=144110&message=4872254&q=#4872254
Which was never fully resolved IMO. Trying to guess what kind of generated output will be created by a JSP and then validating based on that assumption is wrong.
Your particular issue was solved, and the validation for custom tag
documents should work fine, is it?
Grant Smith wrote:
--
Best regards,
Maxim Mossienko
IntelliJ Labs / JetBrains Inc.
http://www.intellij.com
"Develop with pleasure!"
Hi,
This particular jsp does not produce 'Element is not allowed here'
message even after adding taglib directives. Could you please provide
complete complete example.
Marcus Brito wrote:
--
Best regards,
Maxim Mossienko
IntelliJ Labs / JetBrains Inc.
http://www.intellij.com
"Develop with pleasure!"
That html content is not validated (if you have opposite example then
please post them to the tracker).
Pietro Polsinelli wrote:
--
Best regards,
Maxim Mossienko
IntelliJ Labs / JetBrains Inc.
http://www.intellij.com
"Develop with pleasure!"
Max, again, the problem is not with the message -- it's actually correct given the limited information IDEA has about the resulting page (i.e., none). The problem is that I don't care about HTML validation, and I want to turn it off.
Anyways, here goes the full page, attached.
Attachment(s):
cadastrarListaNegra.jsp
Here goes another example, this time using Tapestry, just to spice things up:
Here, the real image URL will be generated by tapestry, at runtime. "dummy.gif" is exactly that, a dummy, non-existant reference. In this situation, IDEA will highlight it as a warning, saying "Cannot resolve symbol dummy.gif".
Tapestry templates are usually just ".html" files, so IDEA will try to validate them as such. However. multiply false warnings like the one shown above by a few hundred tags and you'll have a nice, yellow right gutter that in no way helps me to find real errors.
One can add 'src' as not required html attribute, the problem will
disappear.
Marcus Brito wrote:
--
Best regards,
Maxim Mossienko
IntelliJ Labs / JetBrains Inc.
http://www.intellij.com
"Develop with pleasure!"
Well, 'src' is defined as a required HTML attribute by the W3C specification. Furthermore, I've already turned off the "Required html attributes" inspection in the "Errors" configuration dialog, and I'm still getting these messages.
Seriously, am I alone here? Am I the only one that thinks IDEA should provide an option to completely, irrevocably, definitely turn off all sorts of HTML validation?
+1 for Marcus' request.
In my current work, the only HTML files I'm editing are Tapestry templates. I've tried a few options here and there, but I'm still getting a gutter full of yellow on files that are fine for Tapestry. It's a real pain.
John Hurst
Wellington, New Zealand
Any more particular details will be appreciated.
John Hurst wrote:
--
Best regards,
Maxim Mossienko
IntelliJ Labs / JetBrains Inc.
http://www.intellij.com
"Develop with pleasure!"
Details: turn off every single aspect of HTML validation. We just want syntax highlight, and that's all, folks. Basically, we want a way to make Irida behave exactly the same way Pallada used to, regarding HTML validation.
+1
Marcus, your request can't be any clearer. Thanks for the lobbying!
HTML gets munged in sooooo many ways. I don't have this problem now but I
think I would have had it in the past and I can predict I will be a
potential victim in the future. Therefore this request seems reasonable
to me.
+1
--
Using Opera's revolutionary e-mail client: http://www.opera.com/mail/
Here Here. No HTML inspections please. Validating HTML in most of my projects is futile. Noble effort JetBrains, but forget it, it can't be done for many complex jsp based projects.
The next large JSP based project I start, I'll keep and love the inspections, but for the love of pete, give us a way to turn them off for projects where there is no hope.
+1
While it's clearly a useful feature I don't see why we should have to put up with it for situations where we don't care about having a valid HTML page.
Maxim,
I think a number of others have indicated that HTML validation should be optional. However, since you ask, here are some of the problems I get with Tapestry templates:
1) Tapestry introduces extra non-HTML attributes. The key one is "jwcid", which informs Tapestry that the current tag should be replaced by output from a Tapestry component. Component parameters are also specified by new attributes. They are arbitrary. I can remove the warning messages for these by adding the attributes in the "Unknown HTML Attributes" settings dialog. But I'm going to have to put quite a few of them in there ...
2) As Marcus pointed out, with images in Tapestry the "src " attribute is actually ignored, so I have some files with invalid or missing src. Granted, this can generally be fixed by adding a src that refers to a valid image file.
3) Also the "action" attribute of a ]]> is ignored by Tapestry. I can add an action, e.g. "Home.html" seems to make IDEA happy. I guess I can point each template's action back at the template itself. But now the template is misleading, since the attribute is not functional.
4) IDEA is "validating" the "script" attribute -- but its interpretation is different from Tapestry's, when using the @Script component. Thus IDEA is marking a correct usage with a warning.
Regards
John Hurst
Wellington, New Zealand
Hi,
John Hurst wrote:
Add that attributes to 'Custom html attributes' and warnings about them
should not be reported.
Add 'src' attribute to 'Not required html attributes' and warnings about
them should not be reported.
The same as previous for 'action'.
Please, give more precise description of the problem.
--
Best regards,
Maxim Mossienko
IntelliJ Labs / JetBrains Inc.
http://www.intellij.com
"Develop with pleasure!"
Well, if "jwcid" was the only custom attribute, that would be fine. Actually each tag define a set of custom attributos, and informing IDEA about all of them would be too cumbersome. My solution for that was turning off the "Unknown html attribute" inspection. This seems to work.
Again, the 'src' attribute is not missing -- it's there, but pointing to a non-existant resource. I have the "Required html attributes" inspection turned off, but IDEA still complains to me about these bogus 'src' attributes.
+100
I would also like to see "HTML-like" pages in the old way, where matching tags were highlighted and having validation errors in the pages didn't totally screw up those highlightings. Our pages are FreeMarker templates and in 4.5 vesion I could still work with them just fine, pairing all tags together, even though there were some illegals elements colored in red (those are template engine instructions).
In the vesion 5 I can't do it anymore - FreeMarker processing instructions don't allow me even see where, say, ]]> element closes !
See the screenshot attached
Attachment(s):
1.bmp
Turn off html tree highlighting for this file and it won't bugging you
anymore (it's saved in iws).
IK
Evgeny Goldin wrote:
Do you mean clicking the man's head icon in the bottom-right corner and setting the "Highlighting Level" to "None" ?
If yes - it makes the errors disappear but I still can't see where tag closes. See the screesnhot attached - the cursor stands on the beginning of tag but the matching ]]> isn;t highlighted as it's used to be in version 4.5 ..
Attachment(s):
1.bmp
Maxim,
Yes, thank you, my original problem WAS solved. However, further into the discussion, Igor Kuralenok (JetBrains) made this comment:
+Posted By: Guest: Igor Kuralenok (JetBrains)
I hope this issue will be fixed by next eap. By the way, from next EAP watch for your contentType attribute in page directive since it has influence on our analysis (for your particular case I suppose it will be "text/xml").+
Which scared the hell out of me. If I set my contentType attibute to "text/xml" (for example) and the rest of my file contains Freemarker (or any other) templating code, why should I be forced to endure text/xml-based validation ?
This question was left hanging at the end of the thread, with no answer; hence my statement that it was not fully resolved.
Asking Hector to turn his back on the file will disable all inspections, some useful JSP syntax inspections. That's not what we want, we want to disable all inspections related to HTML syntax and validation. Again, we just want things to be the way they used to be on Pallada.
Marcus Brito wrote:
Actually, that's not true. You can ask Hector to turn his back on HTML checking only.
we just want things to be the way they used to be on Pallada
Exactly. I call it version 4.5, where I could see the pairs of all opening and closing tags even having some weird (FreeMarker) constructs inside
Thanks Brito for making our point so clear. It seems such a simple request.