def parse_blocks(el, text = nil)
@stack.push([@tree, @src, @block_ial])
@tree, @src, @block_ial = el, (text.nil? ? @src : StringScanner.new(text)), nil
status = catch(:stop_block_parsing) do
while !@src.eos?
block_ial_set = @block_ial
@block_parsers.any? do |name|
if @src.check(@parsers[name].start_re)
send(@parsers[name].method)
else
false
end
end || begin
warning('Warning: this should not occur - no block parser handled the line')
add_text(@src.scan(/.*\n/))
end
@block_ial = nil if block_ial_set
end
end
@tree, @src, @block_ial = *@stack.pop
status
end