tylerlong / google-code-prettify

Automatically exported from code.google.com/p/google-code-prettify
Apache License 2.0
0 stars 0 forks source link

Bug with mixing ' (apostrophe) and SQL "--" line comments #26

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?

Insert

{{{
-- Don't
SELECT * from users WHERE id = 3;
-- Don't
}}}

into wiki page and observe how the first apostrophe starts a string and
ends only at the second "Don't".  

This should not happen as the apostrophe is inside a SQL line comment "--".

The HTML generated for the above code is as follows:

{{{
<pre class="prettyprint"><span class="pun">--</span><span class="pln">
</span><span class="typ">Don</span><span class="str">'t<br>SELECT * from
users WHERE id = 3;<br>-- Don'</span><span class="pln">t</span></pre>
}}}

What version are you using?  On what browser?

I'm using the version that's live on code.google.com as of Dec 28, 2007. 
I'm using Firefox but it seems that this is browser compatibility issue.

Original issue reported on code.google.com by jjhel...@gmail.com on 28 Dec 2007 at 10:35

GoogleCodeExporter commented 9 years ago
Grammar at http://savage.net.au/SQL/sql-99.bnf.html#comment

Original comment by mikesamuel@gmail.com on 23 Apr 2008 at 5:50

GoogleCodeExporter commented 9 years ago
Added a SQL language extension:
http://google-code-prettify.googlecode.com/svn/trunk/tests/prettify_test.html#sq
l_lang

See 
http://code.google.com/p/google-code-prettify/source/browse/trunk/src/lang-sql.j
s

Original comment by mikesamuel@gmail.com on 13 Jul 2008 at 10:54