Sha256: 028b7e9b09ec52f17ebaeeb7bb24e42bfb481c5a833056742b2ba7bcdef1ba21

Contents?: true

Size: 353 Bytes

Versions: 11

Compression:

Stored size: 353 Bytes

Contents

require_relative 'processor'

module SSMD::Processors
  class ParagraphProcessor < Processor
    def result
      "<p>" + match.string.gsub(regex, "</p><p>") + "</p>"
    end

    def regex
      /\n\n+/
    end

    def substitute(input)
      result if match
    end

    def strip_ssmd(input)
      input.gsub(regex, "\n") if match
    end
  end
end

Version data entries

11 entries across 11 versions & 1 rubygems

Version Path
ssmd-0.7.6 lib/ssmd/processors/paragraph_processor.rb
ssmd-0.7.5 lib/ssmd/processors/paragraph_processor.rb
ssmd-0.7.4 lib/ssmd/processors/paragraph_processor.rb
ssmd-0.7.3 lib/ssmd/processors/paragraph_processor.rb
ssmd-0.7.2 lib/ssmd/processors/paragraph_processor.rb
ssmd-0.7.1 lib/ssmd/processors/paragraph_processor.rb
ssmd-0.7.0 lib/ssmd/processors/paragraph_processor.rb
ssmd-0.6.1 lib/ssmd/processors/paragraph_processor.rb
ssmd-0.6.0 lib/ssmd/processors/paragraph_processor.rb
ssmd-0.5.0 lib/ssmd/processors/paragraph_processor.rb
ssmd-0.4.0 lib/ssmd/processors/paragraph_processor.rb