Eclipse Indigo generating HTML5 warnings in HTML4 snippets
Question
I work for a company who's primary clients still use Internet Explorer 7 (NHS etc).
In our code we generate snippets of HTML in various places and Eclipse is generating lots of warnings relating to markup that is obsolete in HTML5.
I know that setting a valid doctype of HTML4 fixes the problem on flat html files but as we build the code over several PHP files we can't set a doctype in the snippets.
Is there a way to change the 'default' doctype to HTML4 globally or by project as I do not want to turn off the warnings as that may cause me to miss actual issues.
La solution
Drove me nuts too until I found the answer...
http://www.eclipse.org/forums/index.php/t/219788/
Steps:
- Select an HTML file in the PHP Explorer. If there are no HTML files, create a new one.
- Right-click > Properties > Web Content Settings.
- Choose preferred doctype in the Document type list.
- Click OK and exit Eclipse.
- Open
{your_workspace}/{your_project}/.settings/org.eclipse.wst.html.core.prefs
with a text editor. - Replace
document-type/{your_file_name}=...
bydocument-type/<project>=...
(do not modify<project>
, paste it as-is) - Start Eclipse.
Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow