<commit_before>module Temple
  module HTML
    # @api public
    class Pretty < Fast
      set_default_options :indent => '  ',
                          :pretty => true,
                          :indent_tags => %w(article aside audio base body datalist dd div dl dt
                                             fieldset figure footer form head h1 h2 h3 h4 h5 h6
                                             header hgroup hr html img input li link meta nav ol p
                                             rp rt ruby section script style table tbody td tfoot
                                             th thead title tr ul video).freeze,
                          :pre_tags => %w(code pre textarea).freeze

      def initialize(opts = {})
        super
        @last = :noindent
        @indent = 0
        @pretty = options[:pretty]
        @pre_tags = Regexp.new(options[:pre_tags].map {|t| "<#{t}" }.join('|'))
      end

      def call(exp)
        @pretty ? [:multi, preamble, compile(exp)] : super
      end

      def on_static(content)
        if @pretty
          content.gsub!("\n", indent) if @pre_tags !~ content
          @last = content.sub!(/\r?\n\s*$/, ' ') ? nil : :noindent
        end
        [:static, content]
      end

      def on_dynamic(code)<commit_msg>img tag is inline<commit_after>module Temple
  module HTML
    # @api public
    class Pretty < Fast
      set_default_options :indent => '  ',
                          :pretty => true,
                          :indent_tags => %w(article aside audio base body datalist dd div dl dt
                                             fieldset figure footer form head h1 h2 h3 h4 h5 h6
                                             header hgroup hr html input li link meta nav ol p
                                             rp rt ruby section script style table tbody td tfoot
                                             th thead title tr ul video).freeze,
                          :pre_tags => %w(code pre textarea).freeze

      def initialize(opts = {})
        super
        @last = :noindent
        @indent = 0
        @pretty = options[:pretty]
        @pre_tags = Regexp.new(options[:pre_tags].map {|t| "<#{t}" }.join('|'))
      end

      def call(exp)
        @pretty ? [:multi, preamble, compile(exp)] : super
      end

      def on_static(content)
        if @pretty
          content.gsub!("\n", indent) if @pre_tags !~ content
          @last = content.sub!(/\r?\n\s*$/, ' ') ? nil : :noindent
        end
        [:static, content]
      end

      def on_dynamic(code)
{'fraction_non_alphanumeric': 0.09579439252336448, 'fraction_numerical': 0.005451713395638629, 'mean_word_length': 1.3040358744394618, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 11, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 16, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4407931', 'n_tokens_mistral': 687, 'n_tokens_neox': 663, 'n_words': 219}