Sha256: 7f759b10e0220769996cb325b6e5f133886b7cfefad3f9ab08b1e269d41df1ac

Contents?: true

Size: 695 Bytes

Versions: 38

Compression:

Stored size: 695 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

38 entries across 38 versions & 1 rubygems

Version Path
stepmod-utils-0.4.8 lib/stepmod/utils/converters/blockquote.rb
stepmod-utils-0.4.7 lib/stepmod/utils/converters/blockquote.rb
stepmod-utils-0.4.6 lib/stepmod/utils/converters/blockquote.rb
stepmod-utils-0.4.5 lib/stepmod/utils/converters/blockquote.rb
stepmod-utils-0.4.2 lib/stepmod/utils/converters/blockquote.rb
stepmod-utils-0.4.1 lib/stepmod/utils/converters/blockquote.rb
stepmod-utils-0.4.0 lib/stepmod/utils/converters/blockquote.rb
stepmod-utils-0.3.37 lib/stepmod/utils/converters/blockquote.rb
stepmod-utils-0.3.36 lib/stepmod/utils/converters/blockquote.rb
stepmod-utils-0.3.35 lib/stepmod/utils/converters/blockquote.rb
stepmod-utils-0.3.34 lib/stepmod/utils/converters/blockquote.rb
stepmod-utils-0.3.33 lib/stepmod/utils/converters/blockquote.rb
stepmod-utils-0.3.32 lib/stepmod/utils/converters/blockquote.rb
stepmod-utils-0.3.31 lib/stepmod/utils/converters/blockquote.rb
stepmod-utils-0.3.30 lib/stepmod/utils/converters/blockquote.rb
stepmod-utils-0.3.29 lib/stepmod/utils/converters/blockquote.rb
stepmod-utils-0.3.28 lib/stepmod/utils/converters/blockquote.rb
stepmod-utils-0.3.27 lib/stepmod/utils/converters/blockquote.rb
stepmod-utils-0.3.26 lib/stepmod/utils/converters/blockquote.rb
stepmod-utils-0.3.25 lib/stepmod/utils/converters/blockquote.rb