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

fix(rsx): formatted attribute merging #3719

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

sehnryr
Copy link
Contributor

@sehnryr sehnryr commented Feb 8, 2025

When attributes are merged in Element::merge_attributes, out's source is not updated (I don't know if it should) and even if the segments are trivial, since source is empty we cannot consider it as a "simple expression" by is_simple_expr.

This would result in an issue when merging the following classes with me output being empty:

div {
    class: "foo",
    class: "{bar}",
}

I also modified the merges_attributes test splitting it into different cases:

  • merge_trivial_attributes: merge between two literals
  • merge_formatted_attributes: merge between a literal and a formatted
  • merge_conditional_attributes: merge between a literal and two conditionals
  • merge_all_attributes: merge between all of the above

@sehnryr sehnryr requested a review from a team as a code owner February 8, 2025 23:24
@sehnryr sehnryr force-pushed the fix/merge-formatted-attributes branch from 7d3bc10 to 703d46f Compare February 8, 2025 23:29
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.

1 participant