Skip to content

Conversation

@john-neptune
Copy link
Contributor

@john-neptune john-neptune commented Jan 22, 2024

#1941

Fix prefixing classes on same line as a comment

Before, this worked:

<style>
.cls-1 {}
<!-- foo -->
.cls-2 {}
</style>

but this failed:

<style>
.cls-1 {} <!-- foo -->
.cls-2 {}
</style>

.cls-1 would be prefixed, but .cls-2 and subsquent classes would not.

The root cause is an empty return that was missed during a refactor to
switch from forEach() with a lambda to a for () loop.

Add a new test to cover this case.

Before, this worked:
<style>
.cls-1 {}
<!-- foo -->
.cls-2 {}
</style>

but this failed:
<style>
.cls-1 {} <!-- foo -->
.cls-2 {}
</style>

.cls-1 would be prefixed, but .cls-2 and subsquent classes would not.

The root cause is an empty return that was missed during a refactor to
switch from forEach() with a lambda to a for () loop.

Add a new test to cover this case.
Copy link
Member

@SethFalco SethFalco left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! Thanks for reporting the issue and submitting a patch. This will be in the next release of SVGO.
Also, sorry for breaking your implementation during the rebase of #1736. ^-^'

Co-authored-by: Seth Falco <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants