Sha256: 66a6cbc7428078c2505f1cacaee4c59436a06cc7783a0544a28c795ca1b3d9d8

Contents?: true

Size: 529 Bytes

Versions: 5

Compression:

Stored size: 529 Bytes

Contents

# frozen_string_literal: true

module Stepmod
  module Utils
    module Converters
      class Definition < ReverseAsciidoctor::Converters::Base
        def convert(node, state = {})
          treat_children(node, state)
        end

        private

        def treat_children(node, state)
          res = node.children.map { |child| treat(child, state) }
          res.map(&:strip).reject(&:empty?).join("\n\n")
        end
      end

      ReverseAsciidoctor::Converters.register :definition, Definition.new
    end
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
stepmod-utils-0.1.5 lib/stepmod/utils/converters/definition.rb
stepmod-utils-0.1.4 lib/stepmod/utils/converters/definition.rb
stepmod-utils-0.1.3 lib/stepmod/utils/converters/definition.rb
stepmod-utils-0.1.2 lib/stepmod/utils/converters/definition.rb
stepmod-utils-0.1.1 lib/stepmod/utils/converters/definition.rb