Skip to content

Character count attributes namespace #105

@matthew-shaw

Description

@matthew-shaw

Sorry to jump in (hello from the NHS port 👋)

We spotted another issue where a namespace is necessary:

{%- for name, value in params.formGroup.attributes if params.formGroup %}
{% set attributesHtml = attributesHtml ~ " " ~ name | escape ~ '="' ~ value | escape ~ '"' %}
{% endfor -%}

Using the same approach as the govukAttributes() macro that should be:

{%- for name, value in (params.formGroup.attributes.items() if params.formGroup.attributes else {}.items()) %}
  {% set ns.attributesHtml = '{} {}="{}"'.format(ns.attributesHtml, name | escape, value | escape) %}
{% endfor -%}

For our NHS fix (mostly the same) you can see NHSDigital/nhsuk-frontend-jinja@903bcaf

Originally posted by @colinrotherham in #96 (comment)

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions