How to let Eclipse accept the canvas tag?
Solution 1
This is most likely coming from the Tidy HTML validator packaged with Aptana's version of Eclipse. If you open the preferences for your HTML browser within Aptana, you can add a regular expression to filter the validation errors.
This can be done by going to the Window > Preferences dialog window. Then, expand Aptana > HTML and select 'Validation'.
The filter would probably look like this:
.*<canvas> is not recognized.*
Solution 2
The specific rule under the Aptana>Editors>HTML>Validation filter is
.*<\s*canvas\s*> is not recognized.*
Doing something more generic like .* is not recognized.*
lets any Bad Tag in
Solution 3
The answer, in clear terms, is to go to the HTML>Validation view under preferences as Malaxeur said (for Aptana2 on OSX it was Aptana Studio>Preferences, then Aptana>Editors>HTML>Validation), and create a new rule that resembles the following.
.* is not recognized.*
that's what worked for me. how or why it works, i can't explain.
Solution 4
The error will disappear if using the HTML5 doctype and a more recent version of Eclipse. I'm running Eclipse IDE for Java EE Developers (Build id: 20110218-0911) and do not have this issue.
DNB5brims
Updated on June 29, 2022Comments
-
DNB5brims almost 2 years
I installed the Aptana plugin in my Eclipse, and I use canvas tag in my html file. I find that the Eclipse can't recognize the canvas tag, it highlight my canvas tags, and display follow msg:
< canvas > is not recognized
How can I fix this problem? thx in advance.
-
sorin almost 14 yearsI'm using Aptana Studio 3 (beta) and I was not able to find your option. Any idea?
-
ericsoco almost 13 years@sorin -- malaxuer meant Aptana > Editors > HTML > Validation. pasting the recommended filter text into a new filter in the 'Filter for Validation View Errors' eliminated the <canvas> complaint for me.
-
Gabe almost 13 yearsThis doesn't seem to be true, JTidy still complains
-
vhs over 12 years@Gabe In that case it sounds like JTidy isn't respecting the default validation mechanisms provided by Eclipse. Have they corrected this issue yet?