From 5a6be71791a0cc7199c20d2ac1f248612b805518 Mon Sep 17 00:00:00 2001 From: Johann-S Date: Sun, 21 Jan 2018 21:02:16 +0100 Subject: Remove escaping selector and add a warning to inform folks to escape their selectors (#25390) --- js/src/util.js | 14 -------------- 1 file changed, 14 deletions(-) (limited to 'js/src') diff --git a/js/src/util.js b/js/src/util.js index 6e32e955d..7e5d5de5c 100644 --- a/js/src/util.js +++ b/js/src/util.js @@ -72,15 +72,6 @@ const Util = (($) => { } } - function escapeId(selector) { - // We escape IDs in case of special selectors (selector = '#myId:something') - // $.escapeSelector does not exist in jQuery < 3 - selector = typeof $.escapeSelector === 'function' ? $.escapeSelector(selector).substr(1) - : selector.replace(/(:|\.|\[|\]|,|=|@)/g, '\\$1') - - return selector - } - /** * -------------------------------------------------------------------------- * Public Util Api @@ -105,11 +96,6 @@ const Util = (($) => { selector = element.getAttribute('href') || '' } - // If it's an ID - if (selector.charAt(0) === '#') { - selector = escapeId(selector) - } - try { const $selector = $(document).find(selector) return $selector.length > 0 ? selector : null -- cgit v1.2.3