Switch to more robust existing CSS escaping library

This commit is contained in:
Adam Wathan 2018-06-04 08:50:00 -04:00
parent c678d91fe0
commit 1de2a24eb3
4 changed files with 13 additions and 1 deletions

View file

@ -1,3 +1,5 @@
import escape from 'css.escape'
export default function escapeClassName(className) {
return className.replace(/([^A-Za-z0-9\-])/g, '\\$1')
return escape(className)
}