We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents d09b653 + f38872e commit 15e99c8Copy full SHA for 15e99c8
app/utilities/strings.js
@@ -20,16 +20,22 @@ export const nodeKey = node => {
20
21
export const createClassname = (el, ellipse = false) => {
22
if (!el.className) return ''
23
-
+
24
const combined = Array.from(el.classList).reduce((classnames, classname) =>
25
- classnames += '.' + classname
+ classnames += '.' + escapeSpecialCharacters(classname)
26
, '')
27
28
return ellipse && combined.length > 30
29
? combined.substring(0,30) + '...'
30
: combined
31
}
32
33
+const escapeSpecialCharacters = (query) =>
34
+ Array.from(query)
35
+ .map((char) => /[0-9a-zA-Z_\s-]/.test(char) ? char : `\\${char}`)
36
+ .join("")
37
38
39
export const metaKey = window.navigator.platform.includes('Mac')
40
? 'cmd'
41
: 'ctrl'
0 commit comments