views:

243

answers:

2

How do I stop this warning showing in Eclipse?

Warning: trimming empty <div>

No, I absolutely cannot make the div non-empty, I cannot change the code.

+1  A: 

You could add an HTML comment inside that DIV or go to:

Window -> Preferences -> Web -> HTML Files -> Validation

and play a bit with those values.

Ionuț G. Stan
I don't have that section in preferences
Supertux
What plugin do you have for editing HTML files? Anyway, search inside preferences for "validation". There should be such an item. If not... I don't know.
Ionuț G. Stan
+1  A: 

Even though Ionut G. Stan's method does work, it is probably not the best way to do it, since it will disable this check on all projects."

A better way would be to disable that particular validation for that project only.

To do this right click on the project in the navigator (or package explorer, etc) and select properties. In the preferences you should see "Validation", expand it and select "HTML Syntax". Check the checkbox for "Enable project specific settings". Below this, under the elements section you need to turn off "Invalid empty element tag".

MitMaro
I disabled HTML Syntax for Amateras HTML Editor under prefences - fo r some reason this option didn't appear under Window -> Preferences.Additionally I had to open some files in Amateras HTML Editor in order for the warnings to go away after turning off the validation.
Supertux