Sha256: aa298cd64c1ac5dd594aafe871eb4c8e199d61393c39f9f98a0880a5d5a5c978

Contents?: true

Size: 694 Bytes

Versions: 10

Compression:

Stored size: 694 Bytes

Contents

# frozen_string_literal: true

module Stepmod
  module Utils
    module Converters
      class Blockquote < ReverseAdoc::Converters::Base
        def convert(node, state = {})
          id = node['id']
          anchor = id ? "[[#{id}]]\n" : ""
          cite = node['cite']
          attrs = cite ? "[quote, #{cite}]\n" : ""
          content = treat_children(node, state).strip
          content = ReverseAdoc.cleaner.remove_newlines(content)
          #"\n\n> " << content.lines.to_a.join('> ') << "\n\n"
          "\n\n#{attrs}____\n" << content.lines.to_a.join('') << "\n____\n\n"
        end
      end

      ReverseAdoc::Converters.register :blockquote, Blockquote.new
    end
  end
end

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
stepmod-utils-0.3.5 lib/stepmod/utils/converters/blockquote.rb
stepmod-utils-0.3.4 lib/stepmod/utils/converters/blockquote.rb
stepmod-utils-0.3.2 lib/stepmod/utils/converters/blockquote.rb
stepmod-utils-0.3.1 lib/stepmod/utils/converters/blockquote.rb
stepmod-utils-0.3.0 lib/stepmod/utils/converters/blockquote.rb
stepmod-utils-0.2.7 lib/stepmod/utils/converters/blockquote.rb
stepmod-utils-0.2.6 lib/stepmod/utils/converters/blockquote.rb
stepmod-utils-0.2.5 lib/stepmod/utils/converters/blockquote.rb
stepmod-utils-0.2.4 lib/stepmod/utils/converters/blockquote.rb
stepmod-utils-0.2.3 lib/stepmod/utils/converters/blockquote.rb