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 =~ /^/ @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