Commits

Kirill Simonov committed 3a08ac6

Fixed escaping in the `htraf` demo; a typo in `htsql.tr.scan`.

Comments (0)

Files changed (2)

demo/htraf/static/htraf/js/_htraf.js

 };
 
 htraf.quote = function(s) {
-    return "'" + s.replace(/'/g, "''") + "'";
+    return "'" + escape(s.replace(/'/g, "''")) + "'";
 };
 
 htraf.convertNull = function(value) {

src/htsql/tr/scan.py

             code = match.group('code')
             # Complain if we get `%` not followed by two hexdecimal digits.
             if not code:
-                mark = Mark(match.string, match.begin(), match.end())
+                mark = Mark(match.string, match.start(), match.end())
                 raise ScanError("invalid escape sequence", mark)
             # Return the character corresponding to the escape sequence.
             return chr(int(code, 16))