<%
  title ||= nil
  url ||= nil
  description ||= nil
  highlighted ||= false
  group_index ||= 1
  result_index ||= 1
  css_classes = %w(app-c-result-item)
  css_classes << "app-c-result-item--highlighted" if highlighted
%>
<%= tag.div class: css_classes do %>
  <h4 class="govuk-heading-s">
    <%= link_to title, url,
    class: "govuk-link",
    target: "_blank",
    rel: "noopener noreferrer",
    data: {
      module: "gem-track-click",
      "track-action": "#{group_index}.#{result_index}",
      "track-category": "SmartAnswerClicked",
      "track-label": url
    } %>
  </h4>
  <p class="govuk-body">
    <%= description %>
  </p>
<% end %>

<%
  title ||= nil
  url ||= nil
  description ||= nil
  highlighted ||= false
  group_index ||= 1
  result_index ||= 1
  css_classes = %w(app-c-result-item)
  css_classes << "app-c-result-item--highlighted" if highlighted
%>
<%= tag.div class: css_classes do %>
  <h4 class="govuk-heading-s">
    <%= link_to (title + " (opens in new tab)" if title.present?), url,
    class: "govuk-link",
    target: "_blank",
    rel: "noreferrer noopener",
    data: {
      module: "gem-track-click",
      "track-action": "#{group_index}.#{result_index}",
      "track-category": "SmartAnswerClicked",
      "track-label": url
    } %>
  </h4>
  <p class="govuk-body">
    <%= description %>
  </p>
<% end %>

Update link to provide a warning before automatically opening a new tab
Update link to provide a warning before automatically opening a new tab
