grapesjs
grapesjs copied to clipboard
Updated Selector escapeName to accommodate special characters used in tailwind class names
Tailwind class names use the special characters [, ], (, ), ., %, @, :, /, and +. Several of these were missing from the regex that escapes class names, thereby breaking Taliwind support.
Added checks for comment processing that cause errors outlined in https://github.com/GrapesJS/grapesjs/issues/5720
Are there any updates on this? Currently running into the same problem where my Tailwind classes are being escaped incorrectly.
Also, I noticed this fix doesn't account for classes with a hex color. For example, the class border-[#E9DECC]
will still be converted to border-[-E9DECC]
after this fix. So I think #
also needs to be added to the regex.
I haven't had time to write the tests to commit this pull. On another project right now. Probably won't until the week after next.
I haven't had time to write the tests to commit this pull. On another project right now. Probably won't until the week after next.
Totally understandable, thanks for your efforts!
Added the missing #
+ tests
Thank you!