diff options
author | Adam Chlipala <adam@chlipala.net> | 2011-05-12 17:14:13 -0400 |
---|---|---|
committer | Adam Chlipala <adam@chlipala.net> | 2011-05-12 17:14:13 -0400 |
commit | b2a63d5b664c052d672d8cbde8cbb351b292e4c5 (patch) | |
tree | 7b127a36fbb5427c13faebb5351d949d7feea79d /src | |
parent | e76ab5cc70d54021d19c9aabbb632c922297dda6 (diff) |
Escape less-than in JavaScript strings
Diffstat (limited to 'src')
-rw-r--r-- | src/c/urweb.c | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/src/c/urweb.c b/src/c/urweb.c index 4dae4c3d..1ca45836 100644 --- a/src/c/urweb.c +++ b/src/c/urweb.c @@ -1380,6 +1380,10 @@ uw_Basis_string uw_Basis_jsifyString(uw_context ctx, uw_Basis_string s) { strcpy(s2, "\\\\"); s2 += 2; break; + case '<': + strcpy(s2, "\\074"); + s2 += 4; + break; default: if (isprint((int)c) || c >= 128) *s2++ = c; @@ -1417,6 +1421,10 @@ uw_Basis_string uw_Basis_jsifyChar(uw_context ctx, uw_Basis_char c1) { strcpy(s2, "\\\\"); s2 += 2; break; + case '<': + strcpy(s2, "\\074"); + s2 += 4; + break; default: if (isprint((int)c) || c >= 128) *s2++ = c; @@ -1451,6 +1459,10 @@ uw_Basis_string uw_Basis_jsifyString_ws(uw_context ctx, uw_Basis_string s) { strcpy(s2, "\\\\"); s2 += 2; break; + case '<': + strcpy(s2, "\\074"); + s2 += 4; + break; default: if (isprint((int)c) || c >= 128) *s2++ = c; |