create-figma-plugin icon indicating copy to clipboard operation
create-figma-plugin copied to clipboard

Escaping CSS class names for improved rendering

Open enes-sahin opened this issue 10 months ago • 0 comments

Fix: Rendering of CSS Class Names with Special Characters

In standard CSS naming conventions, class names can include alphanumeric characters, hyphens, and underscores. However, special characters require escaping to ensure proper rendering. This pull request introduces a regex-based solution that replaces special characters with their corresponding escape sequences. This fix guarantees correct rendering of class names containing special characters.

With this fix, the following code snippets can now be displayed correctly:

<div class="!bg-red-500">...</div>
<div class="py-0.5">...</div>
<div class="w-[100px]">...</div>
<div class="hover:text-gray-200">...</div>

enes-sahin avatar Aug 31 '23 09:08 enes-sahin