_docker/lib/export/export_html_post_processor.rb
def post_process_html_dom(drupal_host, export_directory)

    Dir.glob("#{export_directory}/**/*.html") do | html_file |
      @log.info("Post-processing HTML DOM in file '#{html_file}'...")

      html_doc = File.open(html_file) do | file |
        Nokogiri::HTML(file)
      end

      hide_drupal = remove_drupal_host_identifying_markup?(html_doc)
      rewrite_forms = rewrite_form_target_urls?(drupal_host, html_doc, html_file)
      rewrite_access_links = rewrite_access_redhat_com_links(html_doc, html_file)

      if hide_drupal || rewrite_forms || rewrite_access_links
        @log.info("DOM in file '#{html_file}' has been modified, writing new file to disk.")
        File.open(html_file,'w') do | file |
          file.write(html_doc.to_html)
        end
      end

      rewrite_error_page(html_doc, html_file)
    end
  end
#
# This method gives us the chance to make any amendments to the DOM within all HTML files contained
# within the export
#
This method gives us the chance to make any amendments to the DOM within all HTML files contained
within the export
This method gives us the chance to make any amendments to the DOM within all HTML files contained within the export
def post_process_html_dom(drupal_host, export_directory)
    Dir.glob("#{export_directory}/**/*.html") do | html_file |
      @log.info("Post-processing HTML DOM in file '#{html_file}'...")
      html_doc = File.open(html_file) do | file |
        Nokogiri::HTML(file)
      end
      hide_drupal = remove_drupal_host_identifying_markup?(html_doc)
      rewrite_forms = rewrite_form_target_urls?(drupal_host, html_doc, html_file)
      rewrite_access_links = rewrite_access_redhat_com_links(html_doc, html_file)
      if hide_drupal || rewrite_forms || rewrite_access_links
        @log.info("DOM in file '#{html_file}' has been modified, writing new file to disk.")
        File.open(html_file,'w') do | file |
          file.write(html_doc.to_html)
        end
      end
      rewrite_error_page(html_doc, html_file)
    end
  end
def post_process_html_dom ( drupal_host , export_directory ) Dir . glob ( "#{export_directory}/**/*.html" ) do | html_file | @log . info ( "Post-processing HTML DOM in file '#{html_file}'..." ) html_doc = File . open ( html_file ) do | file | Nokogiri :: HTML ( file ) end hide_drupal = remove_drupal_host_identifying_markup? ( html_doc ) rewrite_forms = rewrite_form_target_urls? ( drupal_host , html_doc , html_file ) rewrite_access_links = rewrite_access_redhat_com_links ( html_doc , html_file ) if hide_drupal || rewrite_forms || rewrite_access_links @log . info ( "DOM in file '#{html_file}' has been modified, writing new file to disk." ) File . open ( html_file , 'w' ) do | file | file . write ( html_doc . to_html ) end end rewrite_error_page ( html_doc , html_file ) end end
This method gives us the chance to make any amendments to the DOM within all HTML files contained
within the export
This method gives us the chance to make any amendments to the DOM within all HTML files contained within the export
drupal_host
export_directory