Skip to content

Fix mix with string keys ending in ! - #967

Merged
joeldrapper merged 1 commit into
mainfrom
push-klutknmqkqsk
Jan 17, 2026
Merged

Fix mix with string keys ending in !#967
joeldrapper merged 1 commit into
mainfrom
push-klutknmqkqsk

Conversation

@joeldrapper

Copy link
Copy Markdown
Collaborator

Closes #963

@joeldrapper
joeldrapper merged commit 3c72601 into main Jan 17, 2026
11 of 15 checks passed
@joeldrapper
joeldrapper deleted the push-klutknmqkqsk branch January 17, 2026 17:07

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 3132647a65

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread lib/phlex/helpers.rb
Comment on lines +42 to +43
when String
key.end_with?("!") ? key.chop.to_sym : key

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Normalize string override keys to match string bases

If callers use string keys for attributes (e.g., data parsed from JSON), "class!" should override the existing "class" entry. Here the string override is converted to a symbol while the base string key is left unchanged, so the resulting hash contains both "class" and :class. When rendered, both produce a class attribute, so the override does not actually replace the original and can emit duplicate attributes. This only happens when both the base and override keys are strings.

Useful? React with 👍 / 👎.

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.

Helper mix() raises error when a key ends with ! bang

1 participant