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-2.0.5 lib/rabbit/element/preformatted.rb
rabbit-2.0.4 lib/rabbit/element/preformatted.rb
rabbit-2.0.3 lib/rabbit/element/preformatted.rb
rabbit-2.0.2 lib/rabbit/element/preformatted.rb
rabbit-2.0.1 lib/rabbit/element/preformatted.rb
rabbit-2.0.0 lib/rabbit/element/preformatted.rb
rabbit-1.0.9 lib/rabbit/element/preformatted.rb
rabbit-1.0.8 lib/rabbit/element/preformatted.rb
rabbit-1.0.7 lib/rabbit/element/preformatted.rb
rabbit-1.0.6 lib/rabbit/element/preformatted.rb
rabbit-1.0.5 lib/rabbit/element/preformatted.rb
rabbit-1.0.4 lib/rabbit/element/preformatted.rb
rabbit-1.0.3 lib/rabbit/element/preformatted.rb
rabbit-1.0.2 lib/rabbit/element/preformatted.rb
rabbit-1.0.1 lib/rabbit/element/preformatted.rb
rabbit-1.0.0 lib/rabbit/element/preformatted.rb