Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ensure that media params remain string values #558

Merged
merged 2 commits into from Feb 12, 2024

Conversation

romainmenke
Copy link
Collaborator

fixes : #557

Comment on lines -9 to -21
function split(params, start) {
const list = []
const last = params.reduce((item, node, index) => {
if (index < start) return ""
if (node.type === "div" && node.value === ",") {
list.push(item)
return ""
}
return item + stringify(node)
}, "")
list.push(last)
return list
}
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I overlooked that this was still present and JavaScript automatically joins arrays of strings with ,.

This entire section has become redundant with the refactors for v16.

Copy link
Collaborator

@RyanZim RyanZim left a comment

Choose a reason for hiding this comment

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

Code looks good; should we add a test case with the reproduction from #557?

@romainmenke romainmenke force-pushed the fix-557--intuitive-akita-caa1b56c5d branch from 62dae71 to 2d1301c Compare February 10, 2024 23:40
@romainmenke
Copy link
Collaborator Author

Thank you for reviewing @RyanZim 🙇

I've added a separate plugin that always runs after postcss-import and checks the types of all AtRule AST nodes. This way we get maximum coverage for this aspect as it runs with each test case.

It tests a few more things than just atrule.params, just in case.

@RyanZim RyanZim merged commit ba92913 into master Feb 12, 2024
2 checks passed
@RyanZim RyanZim deleted the fix-557--intuitive-akita-caa1b56c5d branch February 12, 2024 18:49
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.

Emitted @media AtRules are invalid
2 participants