stivoat / tailwind-fold

Visual Studio Code extension that improves code readability by folding long class attributes
https://marketplace.visualstudio.com/items?itemName=stivo.tailwind-fold
MIT License
118 stars 22 forks source link

[Bug] Regex is not working on className in object #45

Open Henry-Hong opened 4 months ago

Henry-Hong commented 4 months ago

Description

Almost everyone uses className prop as a root prop. (<Component className="blabla" />) but, I'm using it in a object as shown below. (<Component objectProp={{ className="blabla" }} />) It makes regex confused and the extension is not working in a good manner.

you can check below screenshots.

Problem screenshot

image

Original

image

stivoat commented 4 months ago

Did you also encounter this issue in the previous version?

Henry-Hong commented 4 months ago

Did you also encounter this issue in the previous version?

I installed previous version (v0.1.0), it works greate on usual usual className usecase but not on usecases like className in an object or className starting with prefixes (twMerge, cn, clsx etc..)

sebaranowski commented 1 month ago

I think the RegEx should ignore strings that contain a newline char completely?