summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--js/lex.js5
-rw-r--r--js/matrix.js2
2 files changed, 5 insertions, 2 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
}
diff --git a/js/matrix.js b/js/matrix.js
index 7549113..1a39742 100644
--- a/js/matrix.js
+++ b/js/matrix.js
@@ -88,7 +88,7 @@ Matrix.prototype.ascii = function () {
var last, line = ""
row.forEach(function(lex, x) {
if (lex.eq(last)) {
- line += lex.char
+ line += lex.sanitize()
}
else {
if (x > 0 && last && (last.bg != 1 || last.fg != 0)) line += "\\x03"