Class: Coradoc::Input::Html::Postprocessor

Inherits:
Object
  • Object
show all
Defined in:
lib/coradoc/html/input/postprocessor.rb

Overview

Postprocessor’s aim is to convert a Coradoc tree from a mess that has been created from HTML into a tree that is compatible with what we would get out of Coradoc, if it parsed it directly.

Now operates on CoreModel types exclusively.

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(coradoc) ⇒ Postprocessor

Returns a new instance of Postprocessor.



17
18
19
# File 'lib/coradoc/html/input/postprocessor.rb', line 17

def initialize(coradoc)
  @tree = coradoc
end

Class Method Details

.process(coradoc) ⇒ Object



13
14
15
# File 'lib/coradoc/html/input/postprocessor.rb', line 13

def self.process(coradoc)
  new(coradoc).process
end

Instance Method Details

#processObject

Main processing entry point



22
23
24
25
26
27
# File 'lib/coradoc/html/input/postprocessor.rb', line 22

def process
  # For now, just return the tree as-is since CoreModel
  # structure is already clean and well-formed.
  # Future: implement CoreModel-based postprocessing
  @tree
end