store-components icon indicating copy to clipboard operation
store-components copied to clipboard

fix(ProductBrand): Correctly display "&" in brand names

Open juliabrzvtex opened this issue 1 month ago • 2 comments

What problem is this solving?

Currently, if a brand name is registered in the catalog containing the HTML entity for the ampersand character (i.e., &), the ProductBrand component renders this entity literally (e.g., "Brand & Test") instead of displaying the correct character (e.g., "Brand & Test").

This also breaks the excludeBrands prop logic. If a store administrator configures "Brand & Test" for exclusion, the comparison fails because the value coming from the product context is "Brand & Test".

This PR normalizes the brand name to resolve both display and exclusion logic issues.

How to test it?

  1. Link this component version in a test store.
  2. Choose a product and, in the catalog, change its brand name to include &. (e.g., My & Brand).
  3. Go to that product's page on the storefront.
  4. Configure the ProductBrand component (either on the product page or in a shelf) to use displayMode="text".
  5. Expected Result (Before): The name appears as "My & Brand".
  6. Expected Result (After): The name appears correctly as "My & Brand".

Screenshots or example usage:

Before: image

After: image

juliabrzvtex avatar Nov 10 '25 13:11 juliabrzvtex

Hi! I'm VTEX IO CI/CD Bot and I'll be helping you to publish your app! 🤖

Please select which version do you want to release:

  • [ ] Patch (backwards-compatible bug fixes)

  • [ ] Minor (backwards-compatible functionality)

  • [ ] Major (incompatible API changes)

And then you just need to merge your PR when you are ready! There is no need to create a release commit/tag.

  • [ ] No thanks, I would rather do it manually 😞

vtex-io-ci-cd[bot] avatar Nov 10 '25 13:11 vtex-io-ci-cd[bot]

Beep boop :robot:

I noticed you didn't make any changes at the docs/ folder

  • [ ] There's nothing new to document :thinking:
  • [ ] I'll do it later :disappointed:

In order to keep track, I'll create an issue if you decide now is not a good time

  • [ ] I just updated :tada::tada:

vtex-io-docs-bot[bot] avatar Nov 10 '25 13:11 vtex-io-docs-bot[bot]