You are an expert in writing code in many different languages. Your goal is to perform code completion for the following code, keeping in mind the rest of the code and the file meta data.
    Metadata details:
    filename: excerpt_parser.rb
    path of file: ./repos/discourse/lib
    
    the code of the file until where you have to start completion: # frozen_string_literal: true

class ExcerptParser < Nokogiri::XML::SAX::Document
  attr_reader :excerpt

  CUSTOM_EXCERPT_REGEX = /<\
    
  def characters(
    string,
    truncate: true,
    count_it: true,
    encode: true,
    before_string: nil,
    after_string: nil
  )
    return if @in_quote

    # we call length on this so might as well ensure we have a string
    string = string.to_s
    if @in_details_depth > 0
      if @in_summary
        @summary_contents << string
      else
        @detail_contents << string
      end