Skip to content

otherAttributes variable in carousel.html escaping special characters #2187

@amandeepsinghvirdi

Description

@amandeepsinghvirdi

Expected behavior

As stated in responsive-img.html:
otherAttributes:
Any other HTML attributes you want on the img tag, for example "height='100' width='100'"

Actual behavior

But if we pass any attribute in the carousel.html to otherAttributes variable, it does not show the attributes correctly in the html.

{{> components/common/responsive-img
      image=stencil_image
      class="heroCarousel-image"
      fallback_size='1280w'
      lazyload='lazyload'
      otherAttributes= 'decoding="async"'
  }}

Steps to reproduce behavior

  1. Go to carousel.html and add some attributes within otherAttributes variable as shown in the actual behavior section
  2. Do view source and you will notice the attributes not rendering correctly in the code

Fix

In responsive-img.html change {{otherAttributes}} to {{{otherAttributes}}}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions