require 'wparser/parse'
module Blocks
class List_number < Parse
def self.parse line
rex = /^\#\s*(\w*)/
@result = if line =~ rex and @list_flag == nil
@list_flag = true
line.sub(rex, "
\n
#$1
")
elsif line =~ rex
line.sub(rex, "
#$1
")
elsif line !~ rex and @list_flag == true
@list_flag = nil
"#{line}\n"
end
super
end
end
end