def self.parse_block_metadata_line reader, document, attributes, options = {}
if (next_line = reader.peek_line) &&
(options[:text] ? (next_line.start_with? '[', '/') : (normal = next_line.start_with? '[', '.', '/', ':'))
if next_line.start_with? '['
if next_line.start_with? '[['
if (next_line.end_with? ']]') && BlockAnchorRx =~ next_line
attributes['id'] = $1
if (reftext = $2)
attributes['reftext'] = (reftext.include? ATTR_REF_HEAD) ? (document.sub_attributes reftext) : reftext
end
return true
end
elsif (next_line.end_with? ']') && BlockAttributeListRx =~ next_line
document.parse_attributes $1, [], :sub_input => true, :into => attributes
return true
end
elsif normal && (next_line.start_with? '.')
if BlockTitleRx =~ next_line
attributes['title'] = $1
return true
end
elsif !normal || (next_line.start_with? '/')
if next_line == '//'
return true
elsif normal && '/' * (ll = next_line.length) == next_line
unless ll == 3
reader.read_lines_until :skip_first_line => true, :preserve_last_line => true, :terminator => next_line, :skip_processing => true
return true
end
else
return true unless next_line.start_with? '///'
end if next_line.start_with? '//'
elsif normal && (next_line.start_with? ':') && AttributeEntryRx =~ next_line
process_attribute_entry reader, document, attributes, $~
return true
end
end
end