From a53544b44a5e4c6fe481072a2eb09c2b003db08c Mon Sep 17 00:00:00 2001 From: megawac Date: Sat, 25 Oct 2014 15:02:12 -0400 Subject: [PATCH] Support MIRC style terminators (^O) --- client/js/libs/handlebars/parse.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/client/js/libs/handlebars/parse.js b/client/js/libs/handlebars/parse.js index 081c69f9..2c7bb443 100644 --- a/client/js/libs/handlebars/parse.js +++ b/client/js/libs/handlebars/parse.js @@ -50,6 +50,7 @@ function uri(text) { var regex = { color: /\003([0-9]{1,2})[,]?([0-9]{1,2})?([^\003]+)/, + terminator: /\x0D/, styles: [ [/\002([^\002]+)(\002)?/, ["", ""]], [/\037([^\037]+)(\037)?/, ["", ""]], @@ -59,6 +60,9 @@ function colors(text) { if (!text) { return text; } + if (regex.terminator.test(text)) { + return $.map(text.split(regex.terminator), colors); + } if (regex.color.test(text)) { var match; while (match = regex.color.exec(text)) {