Module: Grover::HTMLPreprocessor

Defined in:
lib/grover/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



12
13
14
15
16
# File 'lib/grover/html_preprocessor.rb', line 12

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