问题
I'm running Aptana Studio 3, build: 3.1.3.201205292243, Win7 64bit, and I've noticed that after the last update, Aptana is warning me (annotations on the vertical) that I should "trim empty " tags, but these are normal script tags linking an external js file like this:
<!-- Replace favicon.ico & apple-touch-icon.png in the root of your domain and delete these references -->
<link rel="shortcut icon" href="/favicon.ico" />
<link rel="apple-touch-icon" href="/apple-touch-icon.png" />
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js"></script>
<script src="js/jquery.lightbox-0.5.js"></script>
<script src="js/flickrapi3.js"></script>
<link rel="stylesheet" href="css/jquery.lightbox-0.5.css" />
<link rel="stylesheet" href="css/flickrStyle.css" />
Furthermore, it also warns me about the rel attribute inside the link tag as having an "invalid value" and yet these are the defaults included in the HTML5 template Aptana bundles with the release.
I've checked in Preferences>Editors>Text Editors and I see annotation settings but I don't see where I can correct these completely off the wall warnings. Am I missing something entirely here? Are these known bugs? How do I correct these issue?
回答1:
It's just a trick, and make the </script>
in a new line, the warning will disappear, like this below:
<script src="js/jquery.lightbox-0.5.js">
</script>
回答2:
Go to Window > Preferences > Aptana Studio > Validation > HTML.
Change the two checks by "HTML Tidy Validator" into "X". Alternatively, you could click "+" to add a regular expression to filter out the error.
回答3:
Another even simpler workaround to hide the warning is to just put a space in between the tags.
<script src="js/jquery.lightbox-0.5.js"> </script>
回答4:
If you find it annoying having the warning for more than just script tags you can disable it all tags
Go to Window > Preferences > Aptana Studio > Validation
Select HTML Tidy Validator
then some collapse-able options will appear. Select Elements
, it will show a list of option. Now go to the bottom of the list and you'll see Trim empty elements
Change it from warning
to ignore
.
回答5:
This should be fixed in version 3.2.0.201206061952: https://jira.appcelerator.org/browse/APSTUD-4724 So you can pull a nightly build or just wait for them to promote it to release.
来源:https://stackoverflow.com/questions/10864546/aptana-warns-about-script-and-link-tags-when-it-shouldnt