From fa2cf4103993217f8cb6e3ffb65962cf1ae56717 Mon Sep 17 00:00:00 2001 From: Luke Barnard Date: Fri, 3 Mar 2017 15:46:13 +0000 Subject: [PATCH] Make COLOR_REGEX stricter --- src/HtmlUtils.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/HtmlUtils.js b/src/HtmlUtils.js index 04be1154f2..c500076783 100644 --- a/src/HtmlUtils.js +++ b/src/HtmlUtils.js @@ -28,7 +28,7 @@ emojione.imagePathSVG = 'emojione/svg/'; emojione.imageType = 'svg'; const EMOJI_REGEX = new RegExp(emojione.unicodeRegexp+"+", "gi"); -const COLOR_REGEX = /#[0-9a-fA-F]{6}/; +const COLOR_REGEX = /^#[0-9a-fA-F]{6}$/; /* modified from https://github.com/Ranks/emojione/blob/master/lib/js/emojione.js * because we want to include emoji shortnames in title text