<commit_before>module Shared::CatarseAutoHtml
  extend ActiveSupport::Concern

  included do
    AutoHtml.add_filter(:email_image).with(width: 200) do |text, options|
      text.gsub(/http(s)?:\/\/.+\.(jpg|jpeg|bmp|gif|png)(\?\S+)?/i) do |match|
        width = options[:width]
        %|<img src="#{match}" alt="" style="max-width:#{width}px" />|
      end
    end

    AutoHtml.add_filter(:add_alt_link_class) do |text, options|
      text.gsub(/<a/i, '<a class="alt-link"')
    end

    AutoHtml.add_filter(:add_line_breaks) do |text, options|
      text.gsub(/[^>]\n[^<]/i, '<br/>')
    end<commit_msg>Fixes filter, last time I hope<commit_after>module Shared::CatarseAutoHtml
  extend ActiveSupport::Concern

  included do
    AutoHtml.add_filter(:email_image).with(width: 200) do |text, options|
      text.gsub(/http(s)?:\/\/.+\.(jpg|jpeg|bmp|gif|png)(\?\S+)?/i) do |match|
        width = options[:width]
        %|<img src="#{match}" alt="" style="max-width:#{width}px" />|
      end
    end

    AutoHtml.add_filter(:add_alt_link_class) do |text, options|
      text.gsub(/<a/i, '<a class="alt-link"')
    end

    AutoHtml.add_filter(:add_line_breaks) do |text, options|
      text.gsub(/([^\n])\n([^\n])/i, '\1<br/>\2')
    end
{'fraction_non_alphanumeric': 0.20742534301856336, 'fraction_numerical': 0.00645682001614205, 'mean_word_length': 3.397163120567376, 'pattern_counts': {'":': 0, '<': 12, '<?xml version=': 0, '>': 8, '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': '5823134', 'n_tokens_mistral': 486, 'n_tokens_neox': 460, 'n_words': 78}