def parse_extension_start_tag(type)
orig_pos = @src.pos
@src.pos += @src.matched_size
error_block = lambda do |msg|
warning(msg)
@src.pos = orig_pos
add_text(@src.getch) if type == :span
false
end
if @src[4] || @src.matched == '{:/}'
name = (@src[4] ? "for '#{@src[4]}' " : '')
return error_block.call("Invalid extension stop tag #{name}found - ignoring it")
end
ext = @src[1]
opts = {}
body = nil
parse_attribute_list(@src[2] || '', opts)
if !@src[3]
stop_re = (type == :block ? /#{EXT_BLOCK_STOP_STR % ext}/ : /#{EXT_STOP_STR % ext}/)
if result = @src.scan_until(stop_re)
body = result.sub!(stop_re, '')
body.chomp! if type == :block
else
return error_block.call("No stop tag for extension '#{ext}' found - ignoring it")
end
end
if !handle_extension(ext, opts, body, type)
error_block.call("Invalid extension with name '#{ext}' specified - ignoring it")
else
true
end
end