<commit_before>require 'helper'

class TestKramdown < Test::Unit::TestCase
  context "kramdown" do
    setup do
      @config = {
        'markdown' => 'kramdown',
        'kramdown' => {
          'auto_ids'      => false,
          'footnote_nr'   => 1,
          'entity_output' => 'as_char',
          'toc_levels'    => '1..6',
          'smart_quotes'  => 'lsquo,rsquo,ldquo,rdquo'
        }
      }
    end

    # http://kramdown.rubyforge.org/converter/html.html#options
    should "pass kramdown options" do
      markdown = Converters::Markdown.new(@config)
      assert_equal "<h1>Some Header</h1>", markdown.convert('# Some Header #').strip
    end

    should "convert quotes to smart quotes" do
      markdown = Converters::Markdown.new(@config)
      assert_equal "<p>&ldquo;Pit&rsquo;hy&rdquo;</p>", markdown.convert(%{"Pit'hy"}).strip

      override = { 'kramdown' => { 'smart_quotes' => 'lsaquo,rsaquo,laquo,raquo' } }
      markdown = Converters::Markdown.new(@config.deep_merge(override))
      assert_equal "<p>&laquo;Pit&rsaquo;hy&raquo;</p>", markdown.convert(%{"Pit'hy"}).strip
    end
  end
end<commit_msg>Updated Kramdown tests to reflect numeral HTML entities.<commit_after>require 'helper'

class TestKramdown < Test::Unit::TestCase
  context "kramdown" do
    setup do
      @config = {
        'markdown' => 'kramdown',
        'kramdown' => {
          'auto_ids'      => false,
          'footnote_nr'   => 1,
          'entity_output' => 'as_char',
          'toc_levels'    => '1..6',
          'smart_quotes'  => 'lsquo,rsquo,ldquo,rdquo'
        }
      }
    end

    # http://kramdown.rubyforge.org/converter/html.html#options
    should "pass kramdown options" do
      markdown = Converters::Markdown.new(@config)
      assert_equal "<h1>Some Header</h1>", markdown.convert('# Some Header #').strip
    end

    should "convert quotes to smart quotes" do
      markdown = Converters::Markdown.new(@config)
      assert_equal "<p>&#8220;Pit&#8217;hy&#8221;</p>", markdown.convert(%{"Pit'hy"}).strip

      override = { 'kramdown' => { 'smart_quotes' => 'lsaquo,rsaquo,laquo,raquo' } }
      markdown = Converters::Markdown.new(@config.deep_merge(override))
      assert_equal "<p>&#171;Pit&#8250;hy&#187;</p>", markdown.convert(%{"Pit'hy"}).strip
    end
  end
end
{'fraction_non_alphanumeric': 0.16276041666666666, 'fraction_numerical': 0.013888888888888888, 'mean_word_length': 2.9810017271157165, 'pattern_counts': {'":': 0, '<': 17, '<?xml version=': 0, '>': 33, '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': '5769545', 'n_tokens_mistral': 842, 'n_tokens_neox': 780, 'n_words': 136}