Skip to content

Commit

Permalink
Fix incorrect hint or label links for subset options
Browse files Browse the repository at this point in the history
Child option slugs are suffixed with their parent so we should use the original `id` when checking for hints or labels
  • Loading branch information
colinrotherham committed Feb 5, 2024
1 parent e5007cd commit 005e123
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions views/partials/_example.njk
Original file line number Diff line number Diff line change
Expand Up @@ -114,8 +114,8 @@
<strong>Required.</strong>
{% endif %}
{{ option.description | safe }}
{% if (option.params) or ["hint", "label"].includes(option.slug) %}
{% if option.isComponent and not ["hint", "label"].includes(option.slug) %}
{% if (option.params) or ["hint", "label"].includes(option.id) %}
{% if option.isComponent and not ["hint", "label"].includes(option.id) %}
{# Link to subset of Nunjucks macro options table and Design System component page -#}
See supported <a href="#options-{{ exampleId }}--{{ option.slug }}">{{ option.name | safe }}</a> options for <a href="/components/{{ option.slug }}/#options-{{ option.slug }}-example">{{ optionName | safe }}</a>.
{% else %}
Expand Down

0 comments on commit 005e123

Please sign in to comment.