summaryrefslogtreecommitdiff
path: root/js/lex.js
diff options
context:
space:
mode:
Diffstat (limited to 'js/lex.js')
-rw-r--r--js/lex.js5
1 files changed, 4 insertions, 1 deletions
diff --git a/js/lex.js b/js/lex.js
index 17884d1..cf7c655 100644
--- a/js/lex.js
+++ b/js/lex.js
@@ -25,8 +25,11 @@ Lex.prototype.read = function(){
this.char = this.span.innerHTML
return this.char
}
+Lex.prototype.sanitize = function(){
+ return this.char == "%" ? '%%' : this.char || " "
+}
Lex.prototype.irc = function(){
- var char = this.char == "%" ? '%%' : this.char || " "
+ var char = this.sanitize()
if (this.bg == 1 && this.fg == 0) {
return char
}