diff --git a/web/js_tools.anubis b/web/js_tools.anubis index d8ba1cb..06ae9be 100644 --- a/web/js_tools.anubis +++ b/web/js_tools.anubis @@ -20,9 +20,12 @@ define List(Word8) [ ] then reverse(so_far), [h . t] then make_js_string(t, - if h = '\'' then - [h . ['\\' . so_far]] - else + if h = '\'' then [ h, '\\' . so_far] //single quote + else if h = '\r' then ['r', '\\' . so_far] //CR + else if h = '\n' then ['n', '\\' . so_far] //LF + else if h = '\t' then ['t', '\\' . so_far] //tab + else if h = 0x08 then ['b', '\\' . so_far] //Backspace + else [h . so_far] ) }. @@ -44,12 +47,12 @@ public define String String str ) = - "'" + str + "'". + "'" + make_js_string(str) + "'". public define String format_js_function_call ( - String name, - List(String) args + String name, + List(String) args ) = name + "(" + concat(args, ",") + ");". -- libgit2 0.21.4