<commit_before>/ Side-by-side diff view
%div.text-file.diff-wrap-lines.code.file-content.js-syntax-highlight
  %table
    - parallel_diff(diff_file, index).each do |line|
      - type_left = line[0]
      - line_number_left = line[1]
      - line_content_left = line[2]
      - line_code_left = line[3]
      - type_right = line[4]
      - line_number_right = line[5]
      - line_content_right = line[6]
      - line_code_right = line[7]

      %tr.line_holder.parallel
        - if type_left == 'match'
          = render "projects/diffs/match_line_parallel", { line: line_content_left,
          line_old: line_number_left, line_new: line_number_right }
        - elsif type_left ==  'old' || type_left.nil?
          %td.old_line{id: line_code_left, class: "#{type_left}"}
            = link_to raw(line_number_left), "##{line_code_left}", id: line_code_left
            - if @comments_allowed && can?(current_user, :create_note, @project)
              = link_to_new_diff_note(line_code_left, 'old')
            %td.line_content{class: "parallel noteable_line #{type_left} #{line_code_left}", "line_code" => line_code_left }= raw(line_content_left)

          - if type_right == 'new'
            - new_line_class = 'new'
            - new_line_code = line_code_right
          - else
            - new_line_class = nil
            - new_line_code = line_code_left

          %td.new_line{id: new_line_code, class: "#{new_line_class}", data: { linenumber: line_number_right }}
            = link_to raw(line_number_right), "##{new_line_code}", id: new_line_code
            - if @comments_allowed && can?(current_user, :create_note, @project)
              = link_to_new_diff_note(line_code_right, 'new')
            %td.line_content.parallel{class: "noteable_line #{new_line_class} #{new_line_code}", "line_code" => new_line_code}= raw(line_content_right)

      - if @reply_allowed
        - comments_left, comments_right = organize_comments(type_left, type_right, line_code_left, line_code_right)
        - if comments_left.present? || comments_right.present?
          = render "projects/notes/diff_notes_with_reply_parallel", notes_left: comments_left, notes_right: comments_right

- if diff_file.diff.diff.blank? && diff_file.mode_changed?
  .file-mode-changed
    File mode changed<commit_msg>Use html_safe instead of raw. #3945<commit_after>/ Side-by-side diff view
%div.text-file.diff-wrap-lines.code.file-content.js-syntax-highlight
  %table
    - parallel_diff(diff_file, index).each do |line|
      - type_left = line[0]
      - line_number_left = line[1]
      - line_content_left = line[2]
      - line_code_left = line[3]
      - type_right = line[4]
      - line_number_right = line[5]
      - line_content_right = line[6]
      - line_code_right = line[7]

      %tr.line_holder.parallel
        - if type_left == 'match'
          = render "projects/diffs/match_line_parallel", { line: line_content_left,
          line_old: line_number_left, line_new: line_number_right }
        - elsif type_left ==  'old' || type_left.nil?
          %td.old_line{id: line_code_left, class: "#{type_left}"}
            = link_to raw(line_number_left), "##{line_code_left}", id: line_code_left
            - if @comments_allowed && can?(current_user, :create_note, @project)
              = link_to_new_diff_note(line_code_left, 'old')
            %td.line_content{class: "parallel noteable_line #{type_left} #{line_code_left}", "line_code" => line_code_left }= line_content_left.html_safe

          - if type_right == 'new'
            - new_line_class = 'new'
            - new_line_code = line_code_right
          - else
            - new_line_class = nil
            - new_line_code = line_code_left

          %td.new_line{id: new_line_code, class: "#{new_line_class}", data: { linenumber: line_number_right }}
            = link_to raw(line_number_right), "##{new_line_code}", id: new_line_code
            - if @comments_allowed && can?(current_user, :create_note, @project)
              = link_to_new_diff_note(line_code_right, 'new')
            %td.line_content.parallel{class: "noteable_line #{new_line_class} #{new_line_code}", "line_code" => new_line_code}= line_content_right.html_safe

      - if @reply_allowed
        - comments_left, comments_right = organize_comments(type_left, type_right, line_code_left, line_code_right)
        - if comments_left.present? || comments_right.present?
          = render "projects/notes/diff_notes_with_reply_parallel", notes_left: comments_left, notes_right: comments_right

- if diff_file.diff.diff.blank? && diff_file.mode_changed?
  .file-mode-changed
    File mode changed
{'fraction_non_alphanumeric': 0.11719086600603189, 'fraction_numerical': 0.004308487720809996, 'mean_word_length': 3.0338835794960906, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 7, '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': '4377414', 'n_tokens_mistral': 1553, 'n_tokens_neox': 1542, 'n_words': 260}