Sha256: 5c41f3969c04771ce6a9b21d233526011b2d5ee44b235388e902d5392f0babed

Contents?: true

Size: 418 Bytes

Versions: 10

Compression:

Stored size: 418 Bytes

Contents

require "sablon/html/ast"
require "sablon/html/visitor"

module Sablon
  class HTMLConverter
    def process(input, env)
      @env = env
      processed_ast(input).to_docx
    end

    def processed_ast(input)
      ast = build_ast(input)
      ast.accept LastNewlineRemoverVisitor.new
      ast
    end

    def build_ast(input)
      doc = Nokogiri::HTML.fragment(input)
      Root.new(@env, doc)
    end
  end
end

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
sablon-0.4.1 lib/sablon/html/converter.rb
sablon-0.4.0 lib/sablon/html/converter.rb
sablon-0.3.2 lib/sablon/html/converter.rb
sablon-0.3.1 lib/sablon/html/converter.rb
sablon-0.3.0 lib/sablon/html/converter.rb
sablon-0.2.1 lib/sablon/html/converter.rb
sablon-0.2.0 lib/sablon/html/converter.rb
sablon-0.1.1 lib/sablon/html/converter.rb
sablon-0.1.0 lib/sablon/html/converter.rb
sablon-0.0.22 lib/sablon/html/converter.rb