<commit_before>require 'digest_email/digest_element'
require 'kramdown'

module DigestEmail
  class DigestHeader < DigestElement
    attr_accessor :title, :subtitle, :subsubtitle

    def initialize(header)
      super()
      @title = header["title"]

      if header.has_key? "subtitle"
        @subtitle = header["subtitle"]
      else
        @subtitle = nil
      end

      if header.has_key? "subsubtitle"
        @subsubtitle = header["subsubtitle"]
      else
        @subsubtitle = nil
      end
    end

    def render(items)
      parsed_title = Kramdown::Document.new(@title).to_html

      html = ["<div class=\"digest-email-header-title\">#{parsed_title}</div>"]

      unless @subtitle.nil?
        parsed_subtitle = Kramdown::Document.new(@subtitle).to_html
        html << ["<div class=\"digest-email-header-subtitle\">",
                 parsed_subtitle,
                 "</div>"]
      end

      unless @subsubtitle.nil?
        parsed_subsubtitle = Kramdown::Document.new(@subsubtitle).to_html
        html << ["<div class=\"digest-email-header-subsubtitle\">",
                 parsed_subsubtitle,
                 "</div>"]
      end

      # Contents List
      html << ["<div class=\"digest-email-dot-seperator\"></div>"]
      html << render_contents_list(items)
      html << ["<div class=\"digest-email-dot-seperator\"></div>"]

      wrap html.join("\n")
    end

    def render_contents_list(items)
      html =  ["<div class=\"digest-email-header-contents-list\">"]
      html << ["<ol>"]
      html << items.map { |item| "<li>\"#{item.list_title}\"</li>" }.join
      html << ["</ol>"]
      html << ["</div>"]
      html.join
    end
<commit_msg>Removed quotes around contents items<commit_after>require 'digest_email/digest_element'
require 'kramdown'

module DigestEmail
  class DigestHeader < DigestElement
    attr_accessor :title, :subtitle, :subsubtitle

    def initialize(header)
      super()
      @title = header["title"]

      if header.has_key? "subtitle"
        @subtitle = header["subtitle"]
      else
        @subtitle = nil
      end

      if header.has_key? "subsubtitle"
        @subsubtitle = header["subsubtitle"]
      else
        @subsubtitle = nil
      end
    end

    def render(items)
      parsed_title = Kramdown::Document.new(@title).to_html

      html = ["<div class=\"digest-email-header-title\">#{parsed_title}</div>"]

      unless @subtitle.nil?
        parsed_subtitle = Kramdown::Document.new(@subtitle).to_html
        html << ["<div class=\"digest-email-header-subtitle\">",
                 parsed_subtitle,
                 "</div>"]
      end

      unless @subsubtitle.nil?
        parsed_subsubtitle = Kramdown::Document.new(@subsubtitle).to_html
        html << ["<div class=\"digest-email-header-subsubtitle\">",
                 parsed_subsubtitle,
                 "</div>"]
      end

      # Contents List
      html << ["<div class=\"digest-email-dot-seperator\"></div>"]
      html << render_contents_list(items)
      html << ["<div class=\"digest-email-dot-seperator\"></div>"]

      wrap html.join("\n")
    end

    def render_contents_list(items)
      html =  ["<div class=\"digest-email-header-contents-list\">"]
      html << ["<ol>"]
      html << items.map { |item| "<li>#{item.list_title}</li>" }.join
      html << ["</ol>"]
      html << ["</div>"]
      html.join
    end

{'fraction_non_alphanumeric': 0.15498373262348417, 'fraction_numerical': 0.0, 'mean_word_length': 2.3786213786213786, 'pattern_counts': {'":': 0, '<': 73, '<?xml version=': 0, '>': 35, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7228133', 'n_tokens_mistral': 1075, 'n_tokens_neox': 1059, 'n_words': 194}