Sha256: 36eb25ebd8f661de54b4240dc84d1afe174b16afb0ad660cc51a3c0e19557b3c

Contents?: true

Size: 814 Bytes

Versions: 30

Compression:

Stored size: 814 Bytes

Contents

# -*- coding: utf-8 -*-
#
#--
# Copyright (C) 2009-2016 Thomas Leitner <t_leitner@gmx.at>
#
# This file is part of kramdown which is licensed under the MIT.
#++
#

require 'kramdown/parser'
require 'kramdown/converter'
require 'kramdown/utils'

module Kramdown

  module Converter

    # Converts a Kramdown::Document to a nested hash for further processing or debug output.
    class HashAST < Base

      def convert(el)
        hash = {:type => el.type}
        hash[:attr] = el.attr unless el.attr.empty?
        hash[:value] = el.value unless el.value.nil?
        hash[:options] = el.options unless el.options.empty?
        unless el.children.empty?
          hash[:children] = []
          el.children.each {|child| hash[:children] << convert(child)}
        end
        hash
      end

    end

  end
end

Version data entries

30 entries across 29 versions & 11 rubygems

Version Path
logstash-filter-csharp-0.2.1 vendor/bundle/jruby/2.3.0/gems/kramdown-1.13.2/lib/kramdown/converter/hash_ast.rb
logstash-filter-csharp-0.2.0 vendor/bundle/jruby/2.3.0/gems/kramdown-1.13.2/lib/kramdown/converter/hash_ast.rb
logstash-output-icinga-1.1.0 vendor/jruby/1.9/gems/kramdown-1.13.2/lib/kramdown/converter/hash_ast.rb
logstash-output-icinga-1.1.0 vendor/jruby/2.3.0/gems/kramdown-1.13.2/lib/kramdown/converter/hash_ast.rb
logstash-filter-csharp-0.1.0 vendor/bundle/jruby/2.3.0/gems/kramdown-1.13.2/lib/kramdown/converter/hash_ast.rb
logstash-filter-htmlentities-0.1.0 vendor/bundle/jruby/1.9/gems/kramdown-1.13.2/lib/kramdown/converter/hash_ast.rb
logstash-output-icinga-1.0.0 vendor/jruby/1.9/gems/kramdown-1.13.2/lib/kramdown/converter/hash_ast.rb
enju_leaf-1.2.1 vendor/bundle/ruby/2.3/gems/kramdown-1.13.2/lib/kramdown/converter/hash_ast.rb
logstash-filter-zabbix-0.1.2 vendor/bundle/jruby/1.9/gems/kramdown-1.13.2/lib/kramdown/converter/hash_ast.rb
logstash-filter-zabbix-0.1.1 vendor/bundle/jruby/1.9/gems/kramdown-1.13.2/lib/kramdown/converter/hash_ast.rb
logstash-input-fifo-0.9.1 vendor/bundle/jruby/1.9/gems/kramdown-1.13.2/lib/kramdown/converter/hash_ast.rb
logstash-input-fifo-0.9.0 vendor/bundle/jruby/1.9/gems/kramdown-1.13.2/lib/kramdown/converter/hash_ast.rb
logstash-input-salesforce-3.0.0 vendor/jruby/1.9/gems/kramdown-1.13.2/lib/kramdown/converter/hash_ast.rb
kramdown-1.13.2 lib/kramdown/converter/hash_ast.rb
ivanvc-logstash-input-s3-3.1.1.4 vendor/local/gems/kramdown-1.13.1/lib/kramdown/converter/hash_ast.rb
ivanvc-logstash-input-s3-3.1.1.3 vendor/local/gems/kramdown-1.13.1/lib/kramdown/converter/hash_ast.rb
ivanvc-logstash-input-s3-3.1.1.2 vendor/local/gems/kramdown-1.13.1/lib/kramdown/converter/hash_ast.rb
kramdown-1.13.1 lib/kramdown/converter/hash_ast.rb
kramdown-1.13.0 lib/kramdown/converter/hash_ast.rb
logstash-filter-delta-1.1.0 vendor/bundle/jruby/2.2.0/gems/kramdown-1.12.0/lib/kramdown/converter/hash_ast.rb