Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unexpected Token error -- script or slimit issue? #95

Open
jshlbrd opened this issue Jul 12, 2017 · 2 comments
Open

Unexpected Token error -- script or slimit issue? #95

jshlbrd opened this issue Jul 12, 2017 · 2 comments

Comments

@jshlbrd
Copy link

jshlbrd commented Jul 12, 2017

Slimit throws this error ...

SyntaxError: Unexpected token (LT, '<') at 1:0 between None and LexToken(NOT,'!',1,1)

... for this portion of the script ...

<!--
  allClassesLink = document.getElementById("allclasses_navbar_top");
  if(window==top) {
    allClassesLink.style.display = "block";
  }
  else {
    allClassesLink.style.display = "none";
  }
  //-->

Does this seem like an issue with the input script or a case that slimit should be able to handle?

@ghost
Copy link

ghost commented Jul 26, 2017

That first line isn't commented out, this isnt an html parser, that's not valid javascript.

@jshlbrd
Copy link
Author

jshlbrd commented Jul 26, 2017

This is an example from an HTML script block where the type is explicitly called as text/javascript. Here's another example: https://github.com/CartoDB/mobile-android-samples/blob/master/docs/deprecated-list.html

<script type="text/javascript"><!--
    try {
        if (location.href.indexOf('is-external=true') == -1) {
            parent.document.title="Deprecated List";
        }
    }
    catch(err) {
    }
//-->
</script>

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant