This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.
Every tag inside a <fieldset> tag in an erb file will get a red wriggly line, with the message "The tag content is unresolved", unless that tag also contains a <legend> tag. The <legend> tag is an optional tag so that should not be required.
changeset: 132065:884910712c24 user: Marek Fukala <mfukala@netbeans.org> date: Wed May 20 13:02:58 2009 +0200 summary: #165377, 165396, 165475, 165143, 163271, 163242 - fixed a bunch of problems related to the HTML validator/AST provider
I just checked with the latest nightly build (200905260201) and I'm afraid this bug is still there. Easy to reproduce, just try an .erb file with: <fieldset> <b>Hello</b> </fieldset> This will give errors even though it is valid XHTML.
perfectly works for me if there is a proper doctype declaration for XHTML. Check following example in .xhtml file: -------------- <?xml version="1.0" encoding="UTF-8"?> <!-- To change this template, choose Tools | Templates and open the template in the editor. --> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/> <title>TODO supply a title</title> </head> <body> <fieldset> <b>Hello</b> </fieldset> </body> </html> -------------- ... no errors
Sorry to re-open this, but that is not an acceptable solution. .erb files can not normally contain a doctype declaration in Rails unless they happen to be layout partials. For 90%+ of the .erb files that does not work.
hmm hmm, it looks like we really need a way how to specify the html doctype for code fragments (either .html file or various templating languages). I can think of several ways how to do that: 1) default(fallback) HTML doctype set per project (in project UI) which would apply for all html code not explicitly declaring the doctype 2) some patterns definable per project allowing to have more doctypes for various parts of the project 3) hint - Missing HTML doctype definition + fix 'set doctype for this file/folder' for each file with html content w/o doctype decl. #1 seems to be the most straithforward and also simpliest to implement #2 ??? #3 easy to use, harder to implement especially if you want to store the information with the project so it is sharable. possibly could modify the patterns from #2. I belive the doctype is usually the same per project so #1 could be enough. Objections?
I forgot to mention that all the proposed solutions can be done in netbeans 6.8, not 6.7. So for 6.7 you need to disable the checks per file. Some fix can may be delivered in a patch release or via autoupdate later.
I agree, #1 seems a good solution and 6.8 will be soon enough, this is just a minor annoyance. By the way, Netbeans 6.5 didn't have the problem, I guess it just didn't check that strictly. I haven't found a way to disable it on a per file basis like you suggest, is there an option for that? Thanks much for looking into it!
The hint for disabling/enabling the html error check was added a few days before so please download a new build.
*** This issue has been marked as a duplicate of 167968 ***
Sorry, but this is not a duplicate of 167968. In that issue it is described that Netbeans should not flag incorrect HTML if is incomplete because it is generated by a templating language. This issue is that Netbeans actually flags a correct HTML snippet as incorrect. For example, this snippet does not contain any template directives and will be marked as incorrect while it is correct according to W3C specs. <fieldset><div></div></fieldset>
Maybe not duplicate but I won't do anything more than disable the structure checks for embedded html code. The missing doctype declaration is in fact the same problem - the page is not valid according to the specification if it doesn't contain it. If I cannot determine the content type I cannot properly check... this would have to be fixed in the ruby support. So reassigning to ruby, it is up to then if they just consider it as fixed once I fix issue #167968 or they'll develop some better ruby proprietary fix.
But why not simply assume a doctype if none is present, as you suggested yourself earlier? This would solve 90% of the cases without any drawbacks I can think of?
btw, I as noted in the issue #167968 I may create some simple doctype providing SPI which would languages like ruby implement. So we can still do proper checking even w/o the declaration.
html 4.01 transitional is the fallback
Thanks, that sounds great, but if html 4.01 is the fallback why is this marked as incorrect? <fieldset><b>Hello</b></fieldset>
Sorry, never mind that last comment. I just realized that that snippet is only valid in XHTML 1.0.
Fixed in bcde973cca39. You can now use the rhtml.doctype property for specifying the fallback dtd in ruby/rails projects. For example (in nbproject/project.properties): rhtml.doctype=-//W3C//DTD HTML 4.01//EN In ruby/rails projects it defaults to -//W3C//DTD XHTML 1.0 Strict//EN
Excellent thanks!
Integrated into 'main-golden', will be available in build *200909251401* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress) Changeset: http://hg.netbeans.org/main-golden/rev/bcde973cca39 User: Erno Mononen <emononen@netbeans.org> Log: #165475: "fieldset" tag in rhtml incorrectly marked
This was fixed in 6.7 but in 7.0M2 the problem has reappeared.
In 7.0 Beta this has now changed to an ability to set the doctype yourself