From 5941dd4338b73fe05937a14c03a938c0a4bd511b Mon Sep 17 00:00:00 2001 From: tophf Date: Sun, 7 Jan 2018 12:51:22 +0300 Subject: [PATCH] colorpicker hotkey popup: find colors in attributes --- vendor-overwrites/colorpicker/colorview.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/vendor-overwrites/colorpicker/colorview.js b/vendor-overwrites/colorpicker/colorview.js index 8b695767..54a6d024 100644 --- a/vendor-overwrites/colorpicker/colorview.js +++ b/vendor-overwrites/colorpicker/colorview.js @@ -40,11 +40,11 @@ !CSS.supports('color', 'hsl(1turn, 2%, 3%)') && /deg|g?rad|turn/, ].filter(Boolean).map(rx => rx.source).join('|') || '^$', 'i'), }; - const RX_DETECT = new RegExp('(^|[\\s():,/])' + + const RX_DETECT = new RegExp('(^|[\\s(){}[\\]:,/"=])' + '(' + RX_COLOR.hex.source + '|' + '(?:rgb|hsl)a?(?=\\()|(?:' + [...colorConverter.NAMED_COLORS.keys()].join('|') + ')' + - '(?=[\\s;()/]|$)' + + '(?=[\\s;(){}[\\]/"]|$)' + ')', 'gi'); const RX_DETECT_FUNC = /(rgb|hsl)a?\(/iy;