googlearchive / code-prettify

An embeddable script that makes source-code snippets in HTML prettier.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Code-prettify treats the character literal '"' as the start of a double quoted string

mspertus opened this issue · comments

For example, the following snippet from the C++ standard renders as a string starting at the " below

template<class charT>
T11 quoted(const charT* s, charT delim = charT(’"’), charT escape = charT(’\\’));
  // Just green from here on                    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^           
commented

You're using the wrong single-quote character, i.e (U+2019) vs. ' (U+0027).

I'm guessing you copied the snippet from a blog or a word document (which tend to insert these so called "smart quotes")..

Arggh, that is correct! Interestingly, that would have been the first thing I thought of had I pasted it from a web page, but I actually copied it from the C++ Standard PDF itself. Sorry for wasting your time. I may switch this to being an issue with the standard...