diff --git a/app/views/components/_figure.html.erb b/app/views/components/_figure.html.erb index 2d6a8dc1e6..f5ebde28dd 100644 --- a/app/views/components/_figure.html.erb +++ b/app/views/components/_figure.html.erb @@ -1,10 +1,14 @@ -<% add_app_component_stylesheet("figure") %> <% + add_app_component_stylesheet("figure") alt ||= "" caption ||= "" credit ||= "" + lang ||= "en" + component_helper = GovukPublishingComponents::Presenters::ComponentWrapperHelper.new(local_assigns) + component_helper.add_class("app-c-figure") + component_helper.set_lang(lang) %> -
+<%= tag.figure(**component_helper.all_attributes) do %> <% if src.present? %> <%= alt %> <% end %> @@ -22,4 +26,4 @@ <% end %> <% end %> -
+<% end %> diff --git a/app/views/components/docs/figure.yml b/app/views/components/docs/figure.yml index 7e39361a65..811ef2c1be 100644 --- a/app/views/components/docs/figure.yml +++ b/app/views/components/docs/figure.yml @@ -11,7 +11,7 @@ accessibility_criteria: | The figure must: - provide an informative text description, as alt text or caption - +uses_component_wrapper_helper: true examples: default: data: