summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--js/lex.js5
1 files changed, 4 insertions, 1 deletions
diff --git a/js/lex.js b/js/lex.js
index 4c11351..b2f54dc 100644
--- a/js/lex.js
+++ b/js/lex.js
@@ -63,7 +63,10 @@ Lex.prototype.mirc = function(){
Lex.prototype.ansi = function(){
var fg = ansi_fg[ this.fg&15 ]
var bg = ansi_bg[ this.bg&15 ]
- return "\\e[" + fg + ";" + bg + "m" + this.sanitize()
+ var c = this.sanitize()
+ if (c == "\\") c = "\\\\"
+ if (c == '"') c = '\\"'
+ return "\\e[" + fg + ";" + bg + "m" + c
}
Lex.prototype.assign = function (lex){
this.fg = lex.fg