kellym/smartquotes.js

Uncaught SyntaxError: Unexpected token “

Closed this issue · 3 comments

Hi,

It seems smartquotes tries to change quites in the doctype definition i get this error:

Uncaught SyntaxError: Unexpected token “ at line:

Where is your doctype definition? At the top of the document, correct? I tested this page and had no issues with it:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html>
  <head>
    <script src="smartquotes.min.js" type="text/javascript"></script>
  </head>
  <body>
    "this is text"
  </body>
</html>

I even tried it with just the text, the script tag, and the doctype definition (in other words, really bad, invalid HTML) and didn't run into anything. What browser are you using?

Sorry i resolved this but forgot to reply.
It actually wasn't the doctype definition but chrome was saying that it was.
The problem was there was json in the html that wasn't in var tags but just in a hidden div.

I am not sure why chrome was giving me the error in the doctype it was much further in the body.
I just change the js to ignore divs with json and that solver my issue.

Ah perfect, thanks for letting me know.