Aptana Warns about script and link tags when it shouldn't
Asked Answered
H

5

12

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?

Hasbeen answered 2/6, 2012 at 17:41 Comment(1)
Yeah it does that with me too. Just ignore it.Concerned
M
7

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>
Monohydric answered 3/6, 2012 at 16:53 Comment(4)
wow, thanks a lot! Is this issue related to formatting in the editor preferences? In other words, could I adjust my preferences so that perhaps it will accept the script tag all on one line?Hasbeen
also, any idea regarding the warning on the rel attribute for the link tags?Hasbeen
@Hasbeen Also, I found that if you just put a space between the text and the end tag it will remove the error also. Like this: <script src="js/jquery.lightbox-0.5.js"> </script>Inaudible
didn't see Russdog's answer. Oops! :)Inaudible
U
18

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.

Unavoidable answered 6/6, 2012 at 21:18 Comment(2)
I would have selected this answer as the correct one, as it involves a proper solution, and not a workaround to avoid the warning.Epaminondas
Nice answer,should be selected.Menu
M
7

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>
Monohydric answered 3/6, 2012 at 16:53 Comment(4)
wow, thanks a lot! Is this issue related to formatting in the editor preferences? In other words, could I adjust my preferences so that perhaps it will accept the script tag all on one line?Hasbeen
also, any idea regarding the warning on the rel attribute for the link tags?Hasbeen
@Hasbeen Also, I found that if you just put a space between the text and the end tag it will remove the error also. Like this: <script src="js/jquery.lightbox-0.5.js"> </script>Inaudible
didn't see Russdog's answer. Oops! :)Inaudible
D
6

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>
Duct answered 4/6, 2012 at 20:14 Comment(1)
This is also an excellent solution! I'm new to stackoverflow; is there a way to give credit to multiple user for their answer?Hasbeen
C
3

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.

Colotomy answered 14/2, 2013 at 23:2 Comment(0)
I
1

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.

Iranian answered 22/6, 2012 at 19:53 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.