Repository navigation
fix: #280 don’t panic on unparseable inline styles - #282
Merged
noahbald merged 2 commits intoSep 11, 2026
Merged
Conversation
Signed-off-by: Jens Oliver Meiert <jens@meiert.com>
Signed-off-by: Jens Oliver Meiert <jens@meiert.com>
Contributor
Author
|
(@noahbald, typos note addressed.) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
@noahbald, I felt free to quickly sketch this—feel as free to discard:
MinifyStyles::elementcollects candidates withhas_attribute!(element, Style), which is true for anAttr::Unparsed, butexit_documentthen requiredget_attribute_mut!(element_with_style, Style)to yield a parsed stylesheet. Values lightningcss can’t parse trip thatexpectand abort the process—and since panics abort rather than unwind, it can’t be caught from JS.This is the
continueyou suggested in #280: skip those elements, leave the attribute unminified, and don’t err the job.Covers
display:none !ieand*display:none. No IE support implied—the styles pass through untouched. A regression case is added to theminify_stylessnapshot test.(Double-checked, but still relying on some agentic help.)