Cart remove link aria-label contains double-escaped HTML entities
Nobody has claimed this yet.
- Dominant language
- Liquid
- Stars
- 3.1k
- Forks
- 4.5k
- PR merge metrics
- No merged PRs in 30d
Description
Describe the current behavior
Version: Dawn v15.4.0
Description
The cart line-item remove link applies | escape to a value that the t
filter has already escaped, producing a double-escaped entity in the rendered
aria-label. Screen readers announce the literal entity text.
sections/main-cart-items.liquid:305 and snippets/cart-drawer.liquid:354:
{{ 'sections.cart.remove_title' | t: title: item.title | escape }}
t escapes interpolated values for non-_html keys, so item.title is
already 17" x 5.5" before | escape runs. The second escape then
escapes the &, and the server emits aria-label="Remove … 17" …",
which computes to an accessible name containing ".
Dawn already does this correctly elsewhere.
snippets/quick-order-list-row.liquid:285 omits the | escape and produces
a correct accessible name from the same construction.
Reproduce
- Create a product whose variant title contains a
"character (common for
dimensions —40" x 5.8"). - Add it to the cart.
- Inspect the remove link's computed accessible name, or listen with a
screen reader.
Expected: Remove … 40" x 5.8" / Semi-Gloss
Actual: Remove … 40" x 5.8" / Semi-Gloss
On the store where this was found, 407 of 578 products (70%) are affected,
because inch marks appear throughout the catalogue.
Fix
Drop the redundant | escape at both sites, matching
quick-order-list-row.liquid.
Describe the expected behavior
Version information (Dawn, browsers and operating systems)
- Dawn Version: 7.0.1
- Chrome Version 108.0.5359.124
- macOS Version 13.1
Possible solution
Additional context/screenshots
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with sections/main-cart-items.liquid:305 and snippets/cart-drawer.liquid:354, then compare their remove-link translation with snippets/quick-order-list-row.liquid:285. Remove the redundant escaping at both sites as described, and verify with a product title containing quotation marks that the computed accessible name shows the quotation marks rather than an entity string.
Written by the indexing model from the issue text.
Assessment
- Domain
- accessibility, frontend
- Issue type
- Bug
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Active
- Clarity
- Clearly specified
- Newbie friendliness
- 92/100