css-what icon indicating copy to clipboard operation
css-what copied to clipboard

fix: escape slash, comma and semicolon char when stringify name

Open kainstar opened this issue 6 months ago • 1 comments

add slash, comma and semicolon char in charsToEscapeInName to support class like:

import { stringify, parse } from 'css-what';

const selector = parse('.before\\:bottom-1\\/2, .bg-\\[hsl\\(227\\,91\\%\\,65\\%\\)\\;\\]');
console.log(stringify(selector)); // .before\:bottom-1\/2, .bg-\[hsl\(227\,91\%\,65\%\)\;\]

kainstar avatar Jul 03 '25 10:07 kainstar

Thanks a lot @kainstar! Could you also add a test case? (The example you gave in the PR description would suffice.)

fb55 avatar Jul 20 '25 20:07 fb55