JPeer264 / node-rename-css-selectors

📝 Rename css classes and id's in files
MIT License
65 stars 9 forks source link

Bug: Textarea and other common words replaced #84

Closed pacifier007 closed 2 years ago

pacifier007 commented 2 years ago

Version info:

    "rcs-core": "^3.7.0",
    "rename-css-selectors": "^4.1.0",

Example CSS:

textarea { color: red; }
.text { color: green; }

Result:

tarea { color: red; }
.t { color: green; }

Simple normal JS:

    rcs.process.auto('css/amp.css', {ignoreCssVariables: true})
        .then(() => rcs.mapping.generate('./inc', {fileName: 'map', overwrite: true}))

My CSS file was very large with many replacements gone awry, but I created a simpler case to present the bug.

Is the parser/regex broken somewhere. That's really odd that it's doing a simple replace such as this. Not sure what's going on. This used to work fine in 3.x.

JPeer264 commented 2 years ago

Hey thanks for your issue.

Oofs, that is definitely a bug. I will look into it rn.

JPeer264 commented 2 years ago

should be fixed in rcs-core@3.7.1

pacifier007 commented 2 years ago

Perfect. That was an amazingly quick fix. Many thanks.