def self.parse_block_metadata_line(reader, parent, attributes, options = {})
return false unless reader.has_more_lines?
next_line = reader.peek_line
if (commentish = next_line.start_with?('//')) && (match = CommentBlockRx.match(next_line))
terminator = match[0]
reader.read_lines_until(:skip_first_line => true, :preserve_last_line => true, :terminator => terminator, :skip_processing => true)
elsif commentish && CommentLineRx =~ next_line
elsif !options[:text] && next_line.start_with?(':') && (match = AttributeEntryRx.match(next_line))
process_attribute_entry(reader, parent, attributes, match)
elsif (in_square_brackets = next_line.start_with?('[') && next_line.end_with?(']')) && (match = BlockAnchorRx.match(next_line))
unless match[1].nil_or_empty?
attributes['id'] = match[1]
attributes['reftext'] = match[2] unless match[2].nil?
end
elsif in_square_brackets && (match = BlockAttributeListRx.match(next_line))
parent.document.parse_attributes(match[1], [], :sub_input => true, :into => attributes)
elsif !options[:text] && (match = BlockTitleRx.match(next_line))
attributes['title'] = match[1]
else
return false
end
true
end