Sha256: bf16133a48b3152e692c82120ca6e11a5adae80a1c1b4447b4e7c1ee48d48bf8

Contents?: true

Size: 387 Bytes

Versions: 2

Compression:

Stored size: 387 Bytes

Contents

# > # foo
# > # bar
# > ↓
# > foo
# > bar
module Source2MD
  module Type
    class ElementText < Base
      def self.accept?(element)
        if element.head.blank?
          element.body.lines.all? { |e| e.start_with?("# ") }
        end
      end

      def to_md
        body
      end

      private

      def body
        element.body.gsub(/^# /, "")
      end
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
source2md-0.0.2 lib/source2md/type/element_text.rb
source2md-0.0.1 lib/source2md/type/element_text.rb