summaryrefslogtreecommitdiff
path: root/js/lex.js
diff options
context:
space:
mode:
authorJules <jules@asdf.us>2014-11-30 16:54:12 -0500
committerJules <jules@asdf.us>2014-11-30 16:54:12 -0500
commitcea658bee03c9dc1843916ccd3c49bd67481e3b2 (patch)
treed75b7ca251b87f43422ae2f606071b98cff40458 /js/lex.js
parentb25804afdf38918c9e205e9acda50bdbfe24cd12 (diff)
parent4f2f5dc5580359bba21150af3ce5d34ad14b3ab4 (diff)
Merge branch 'master' of ghghgh.us:ascii
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){