From c1330dc0500c6829116a571f4d57ca203af3e2e0 Mon Sep 17 00:00:00 2001 From: Guangcong Luo Date: Mon, 29 Jun 2015 17:19:35 -0400 Subject: [PATCH] Support <> links in chat --- js/battledata.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/js/battledata.js b/js/battledata.js index d6cc948e2..3cceaefcf 100644 --- a/js/battledata.js +++ b/js/battledata.js @@ -362,7 +362,7 @@ var Tools = { // Don't format console commands (>>). if (str.substr(0, 8) === '>>') return str; // Don't format console results (<<). - if (str.substr(0, 8) === '<<') return str; + if (str.substr(0, 9) === '<< ') return str; var options = Tools.prefs('chatformatting') || {}; @@ -372,6 +372,9 @@ var Tools = { // ~~strikethrough~~ str = str.replace(/\~\~([^< ](?:[^<]*?[^< ])??)\~\~/g, options.hidestrikethrough ? '$1' : '$1'); + // <> + str = str.replace(/<<([a-z0-9-]+)>>/g, + options.hidelinks ? '«$1»' : '«$1»'); // linking of URIs if (!options.hidelinks) { str = str.replace(linkRegex, function(uri) {