Sha256: 0ce794b1e57b586037f061b6b627d8f6c84fb9e19085e6c61d86182ac2a76c45

Contents?: true

Size: 807 Bytes

Versions: 1

Compression:

Stored size: 807 Bytes

Contents

require 'wparser/block/pre'
require 'wparser/block/blockquote'
require 'wparser/block/list_number'
require 'wparser/block/list_nonumber'

module Block
  include Blocks

  def parse text
    @protected_preTag = nil
    parse_text = text.each_line.collect{|line| parse_line line}
  end

  private
  def parse_line line
    parse_line = line
    parse_line = Pre.parse parse_line

    if parse_line =~ /^<pre.*>/
      @protected_preTag = true
    elsif parse_line =~ /<\/pre>/
      @protected_preTag = nil
    end

    #puts @protected_preTag

    if @protected_preTag == nil
      parse_line = Blockquote.parse   parse_line
      parse_line = List_number.parse   parse_line
      parse_line = List_nonumber.parse parse_line
    else
      parse_line
    end
  end

  module_function :parse, :parse_line
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
wparser-0.1.3 lib/wparser/block/block.rb