Module: FerrumPdf::HTMLPreprocessor

Defined in:
lib/ferrum_pdf/html_preprocessor.rb

Overview

Helper module for preparing HTML for conversion

Sourced from the PDFKit project

Class Method Summary collapse

Class Method Details

.process(html, root_url, protocol) ⇒ Object

Change relative paths to absolute, and relative protocols to absolute protocols



8
9
10
11
12
# File 'lib/ferrum_pdf/html_preprocessor.rb', line 8

def self.process(html, root_url, protocol)
  html = translate_relative_paths(html, root_url) if root_url
  html = translate_relative_protocols(html, protocol) if protocol
  html
end