# File lib/html/sgml-parser.rb, line 279
     def finish_endtag(tag)
       if tag == ''
         found = @stack.length - 1
         if found < 0
           unknown_endtag(tag)
           return
         end
       else
         unless @stack.include? tag
           method = 'end_' + tag
           unless self.respond_to?(method)
             unknown_endtag(tag)
           end
           return
         end
         found = @stack.index(tag) #or @stack.length

       end
       while @stack.length > found
         tag = @stack[-1]
         method = 'end_' + tag
         if respond_to?(method)
           handle_endtag(tag, method)
         else
           unknown_endtag(tag)
         end
         @stack.pop
       end
     end