diff --git a/app/controllers/content_items_controller.rb b/app/controllers/content_items_controller.rb index 42c6963e5..bacd7024d 100644 --- a/app/controllers/content_items_controller.rb +++ b/app/controllers/content_items_controller.rb @@ -137,7 +137,7 @@ def render_template end # use these and `@content_item.base_path` in the template - @notification_button_visible = @content_item.has_single_page_notifications? && !@content_item.brexit_child_taxon + @notification_button_visible = @content_item.has_single_page_notifications? @include_single_page_notification_button_js = account_session_header.present? request.variant = :print if params[:variant] == "print" diff --git a/app/lib/body_parser.rb b/app/lib/body_parser.rb deleted file mode 100644 index 7fcc56c5a..000000000 --- a/app/lib/body_parser.rb +++ /dev/null @@ -1,76 +0,0 @@ -class BodyParser - def initialize(body) - @body = body - end - - def title_and_link_sections - if raw_title_and_link_sections.any? - raw_title_and_link_sections.map do |section| - s = parse(section) - { - title: parsed_title(s), - links: parsed_links(s), - } - end - end - end - -private - - attr_reader :body - - def parse(html) - Nokogiri::HTML.parse(html) - rescue Nokogiri::XML::SyntaxError - "" - end - - def parsed_body - @parsed_body ||= parse(body) - end - - def raw_body_content - if parsed_body.present? - parsed_body.search("div.govspeak").children - end - end - - def raw_title_and_link_sections - if raw_body_content.any? - raw_body_content.to_s.split(/(?=
- <%= I18n.t("brexit.heading_prefix") %> - <%= link_to( - brexit_child_taxon[:nav_link][:text], - brexit_child_taxon[:nav_link][:path], - class: "govuk-link", - data: { - track_action: brexit_child_taxon[:nav_link][:path], - track_category: brexit_child_taxon[:nav_link][:track_category], - track_label: brexit_child_taxon[:nav_link][:track_label], - module: 'gem-track-click', - }) %>. -
-