class Sablon::HTMLConverter

Public Instance Methods

build_ast(input) click to toggle source
# File lib/sablon/html/converter.rb, line 17
def build_ast(input)
  doc = Nokogiri::HTML.fragment(input)
  Root.new(@env, doc)
end
process(input, env) click to toggle source
# File lib/sablon/html/converter.rb, line 6
def process(input, env)
  @env = env
  processed_ast(input).to_docx
end
processed_ast(input) click to toggle source
# File lib/sablon/html/converter.rb, line 11
def processed_ast(input)
  ast = build_ast(input)
  ast.accept LastNewlineRemoverVisitor.new
  ast
end