Sha256: 51c20a21539a267b66b0e74ed4a74464bf3657d2caa5009b46afcb46018c4a69

Contents?: true

Size: 1.23 KB

Versions: 212

Compression:

Stored size: 1.23 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 %>
      <% puts "
        You've passed in unsanitised HTML into the govspeak component as the
        `content` param.

        Passing in unsafe HTML is deprecated and will be removed in a future
        version. You need to pass in a block instead or use the `capture` helper.

        See the component guide for examples.

        If you're 100% sure there's no unsanitised user input in the string you
        could also call `.html_safe` on the string or use the `raw` helper before
        passing it in.

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

Version data entries

212 entries across 212 versions & 1 rubygems

Version Path
govuk_publishing_components-21.69.0 app/views/govuk_publishing_components/components/_govspeak.html.erb
govuk_publishing_components-21.68.1 app/views/govuk_publishing_components/components/_govspeak.html.erb
govuk_publishing_components-21.68.0 app/views/govuk_publishing_components/components/_govspeak.html.erb
govuk_publishing_components-21.67.2 app/views/govuk_publishing_components/components/_govspeak.html.erb
govuk_publishing_components-21.67.1 app/views/govuk_publishing_components/components/_govspeak.html.erb
govuk_publishing_components-21.67.0 app/views/govuk_publishing_components/components/_govspeak.html.erb
govuk_publishing_components-21.66.4 app/views/govuk_publishing_components/components/_govspeak.html.erb
govuk_publishing_components-21.66.3 app/views/govuk_publishing_components/components/_govspeak.html.erb
govuk_publishing_components-21.66.2 app/views/govuk_publishing_components/components/_govspeak.html.erb
govuk_publishing_components-21.66.1 app/views/govuk_publishing_components/components/_govspeak.html.erb
govuk_publishing_components-21.66.0 app/views/govuk_publishing_components/components/_govspeak.html.erb
govuk_publishing_components-21.65.1 app/views/govuk_publishing_components/components/_govspeak.html.erb
govuk_publishing_components-21.65.0 app/views/govuk_publishing_components/components/_govspeak.html.erb
govuk_publishing_components-21.64.0 app/views/govuk_publishing_components/components/_govspeak.html.erb
govuk_publishing_components-21.63.3 app/views/govuk_publishing_components/components/_govspeak.html.erb
govuk_publishing_components-21.63.2 app/views/govuk_publishing_components/components/_govspeak.html.erb
govuk_publishing_components-21.63.1 app/views/govuk_publishing_components/components/_govspeak.html.erb
govuk_publishing_components-21.63.0 app/views/govuk_publishing_components/components/_govspeak.html.erb
govuk_publishing_components-21.62.0 app/views/govuk_publishing_components/components/_govspeak.html.erb
govuk_publishing_components-21.61.0 app/views/govuk_publishing_components/components/_govspeak.html.erb