Sha256: f6edf2387041c75b39a2b9f78496d5adf1cb025d98b53ad56efa86233cd06808

Contents?: true

Size: 538 Bytes

Versions: 36

Compression:

Stored size: 538 Bytes

Contents

require 'rabbit/element/text-block-element'
require 'rabbit/element/block-element'

module Rabbit
  module Element
    class PreformattedBlock
      include TextBlockElement
      include BlockHorizontalCentering

      def text
        super.gsub(/^/, "  ")
      end

      def to_rd
        text
      end

      def to_html(generator)
        "<pre#{attributes}>#{super}</pre>"
      end

      private
      def attributes
        ""
      end
    end

    class PreformattedText
      include TextContainerElement
    end
  end
end

Version data entries

36 entries across 36 versions & 1 rubygems

Version Path
rabbit-3.0.3 lib/rabbit/element/preformatted.rb
rabbit-3.0.2 lib/rabbit/element/preformatted.rb
rabbit-3.0.1 lib/rabbit/element/preformatted.rb
rabbit-3.0.0 lib/rabbit/element/preformatted.rb
rabbit-2.2.1 lib/rabbit/element/preformatted.rb
rabbit-2.2.0 lib/rabbit/element/preformatted.rb
rabbit-2.1.9 lib/rabbit/element/preformatted.rb
rabbit-2.1.8 lib/rabbit/element/preformatted.rb
rabbit-2.1.7 lib/rabbit/element/preformatted.rb
rabbit-2.1.6 lib/rabbit/element/preformatted.rb
rabbit-2.1.5 lib/rabbit/element/preformatted.rb
rabbit-2.1.4 lib/rabbit/element/preformatted.rb
rabbit-2.1.3 lib/rabbit/element/preformatted.rb
rabbit-2.1.2 lib/rabbit/element/preformatted.rb
rabbit-2.1.1 lib/rabbit/element/preformatted.rb
rabbit-2.1.0 lib/rabbit/element/preformatted.rb
rabbit-2.0.9 lib/rabbit/element/preformatted.rb
rabbit-2.0.8 lib/rabbit/element/preformatted.rb
rabbit-2.0.7 lib/rabbit/element/preformatted.rb
rabbit-2.0.6 lib/rabbit/element/preformatted.rb