Sha256: 3a97ce7d1eb3dc645b9eaf6f5e81bae9f049338a7bdbdb41bfdb1fb4f9af120e

Contents?: true

Size: 1.11 KB

Versions: 82

Compression:

Stored size: 1.11 KB

Contents

<%
  direction_class = "direction-#{direction}" if local_assigns.include?(:direction)
  disable_youtube_expansions = local_assigns.fetch(:disable_youtube_expansions) if local_assigns.include?(:disable_youtube_expansions)

  classes = []
  classes << direction_class if direction_class
  classes << "disable-youtube" if disable_youtube_expansions
%>

<div class="gem-c-govspeak govuk-govspeak <%= classes.join(" ") %>" data-module="govspeak">
  <% if local_assigns.include?(:content) %>
    <% if content.html_safe? %>
      <%= content %>
    <% else %>
      <% raise "
        You've passed in unsanitised HTML into the Govspeak component as the
        `content` parameter.

        To fix this use a `do` block with the sanitize method - see
        https://components.publishing.service.gov.uk/component-guide/govspeak/
        for the updated documentation and
        https://github.com/alphagov/govuk_publishing_components/pull/1632/
        for further examples.

        Called from #{caller_locations.find { |l| l.to_s.include?('.erb') }}
        " %>
    <% end %>
  <% elsif block_given? %>
    <%= yield %>
  <% end %>
</div>

Version data entries

82 entries across 82 versions & 1 rubygems

Version Path
govuk_publishing_components-24.19.0 app/views/govuk_publishing_components/components/_govspeak.html.erb
govuk_publishing_components-24.18.5 app/views/govuk_publishing_components/components/_govspeak.html.erb
govuk_publishing_components-24.18.4 app/views/govuk_publishing_components/components/_govspeak.html.erb
govuk_publishing_components-24.18.3 app/views/govuk_publishing_components/components/_govspeak.html.erb
govuk_publishing_components-24.18.2 app/views/govuk_publishing_components/components/_govspeak.html.erb
govuk_publishing_components-24.18.1 app/views/govuk_publishing_components/components/_govspeak.html.erb
govuk_publishing_components-24.18.0 app/views/govuk_publishing_components/components/_govspeak.html.erb
govuk_publishing_components-24.17.0 app/views/govuk_publishing_components/components/_govspeak.html.erb
govuk_publishing_components-24.16.1 app/views/govuk_publishing_components/components/_govspeak.html.erb
govuk_publishing_components-24.16.0 app/views/govuk_publishing_components/components/_govspeak.html.erb
govuk_publishing_components-24.15.3 app/views/govuk_publishing_components/components/_govspeak.html.erb
govuk_publishing_components-24.15.2 app/views/govuk_publishing_components/components/_govspeak.html.erb
govuk_publishing_components-24.15.1 app/views/govuk_publishing_components/components/_govspeak.html.erb
govuk_publishing_components-24.15.0 app/views/govuk_publishing_components/components/_govspeak.html.erb
govuk_publishing_components-24.14.1 app/views/govuk_publishing_components/components/_govspeak.html.erb
govuk_publishing_components-24.14.0 app/views/govuk_publishing_components/components/_govspeak.html.erb
govuk_publishing_components-24.13.5 app/views/govuk_publishing_components/components/_govspeak.html.erb
govuk_publishing_components-24.13.4 app/views/govuk_publishing_components/components/_govspeak.html.erb
govuk_publishing_components-24.13.3 app/views/govuk_publishing_components/components/_govspeak.html.erb
govuk_publishing_components-24.13.2 app/views/govuk_publishing_components/components/_govspeak.html.erb