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: clean_html_berry.rb
    path of file: ./repos/devdocs/lib/docs/filters/yarn
    
    the code of the file until where you have to start completion: module Docs
  class Yarn
    class CleanHtmlBerryFilter < Filter
      def call
        if slug.empty?
          @doc = at_css('main')
         
    
      def call
        if slug.empty?
          @doc = at_css('main')
          css(
            (['div:first-child'] * 3).join('>'), # Tagline
            'img',
            'hr', # Footer
            'hr + div', # Footer
          ).remove

          css('a').each do |link|
            link.name = 'div'
            link.css('h3').each do |node|
              node.replace("<h2><a href='#{link['href']}'>#{node.content}</a></h2>")
            end
          end

          return doc
        end

        @doc = at_css('article')
        # Heading & edit link
        css('h1', 'h1 + a').remove unless slug.start_with?('configuration')

        if slug.start_with?('cli')
          css('.header-code').each do |node|
            node.name = 'span'
          end
        end