lib/asciidoctor/lexer.rb in asciidoctor-0.0.4 vs lib/asciidoctor/lexer.rb in asciidoctor-0.0.5
- old
+ new
@@ -61,13 +61,17 @@
while reader.has_lines? && block.nil?
buffer.clear
this_line = reader.get_line
next_line = reader.peek_line || ''
- if this_line.match(REGEXP[:comment])
+ if this_line.match(REGEXP[:comment_blk])
+ Reader.new(reader.grab_lines_until {|line| line.match( REGEXP[:comment_blk] ) })
next
+ elsif this_line.match(REGEXP[:comment])
+ next
+
elsif match = this_line.match(REGEXP[:title])
title = match[1]
reader.skip_blank
elsif match = this_line.match(REGEXP[:listing_source])
@@ -657,11 +661,13 @@
section_reader = Reader.new(section_lines)
# Now parse section_lines into Blocks belonging to the current Section
while section_reader.has_lines?
section_reader.skip_blank
- new_block = next_block(section_reader, section) if section_reader.has_lines?
- section << new_block unless new_block.nil?
+ if section_reader.has_lines?
+ new_block = next_block(section_reader, section)
+ section << new_block unless new_block.nil?
+ end
end
section
end