summaryrefslogtreecommitdiff
path: root/js/lex.js
diff options
context:
space:
mode:
Diffstat (limited to 'js/lex.js')
-rw-r--r--js/lex.js13
1 files changed, 10 insertions, 3 deletions
diff --git a/js/lex.js b/js/lex.js
index cf7c655..29f452b 100644
--- a/js/lex.js
+++ b/js/lex.js
@@ -25,16 +25,23 @@ Lex.prototype.read = function(){
this.char = this.span.innerHTML
return this.char
}
+Lex.prototype.ascii = function(){
+ return this.char || " "
+}
Lex.prototype.sanitize = function(){
return this.char == "%" ? '%%' : this.char || " "
}
-Lex.prototype.irc = function(){
- var char = this.sanitize()
+var fgOnly = false
+Lex.prototype.mirc = function(){
+ var char = this.char || " "
+ if (fgOnly) {
+ return "\x03" + (this.fg&15) + char
+ }
if (this.bg == 1 && this.fg == 0) {
return char
}
else {
- return "\\x03" + (this.fg&15) + "," + (this.bg&15) + char
+ return "\x03" + (this.fg&15) + "," + (this.bg&15) + char
}
}
Lex.prototype.clone = function (lex){