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

Class attribute cannot be removed via the |attr filter #7234

Closed
rungta opened this issue Dec 7, 2020 · 2 comments
Closed

Class attribute cannot be removed via the |attr filter #7234

rungta opened this issue Dec 7, 2020 · 2 comments
Labels

Comments

@rungta
Copy link

rungta commented Dec 7, 2020

Description

This example from the docs for |attr does not appear to be working in Craft 3.5:

{% set tag = '<div class="foo">' %}
{{ tag|attr({class: false})|attr({class: 'bar'}) }}
{# Output: <div class="bar"> #}

Actual output: <div class="foo bar">

Additional info

  • Craft version: 3.5.16
  • PHP version: 7.1
@brandonkelly
Copy link
Member

Thanks for pointing that out! Just fixed this for the next release.

brandonkelly added a commit that referenced this issue Dec 10, 2020
@brandonkelly
Copy link
Member

Craft 3.5.17 is out now with this fix.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants