<commit_before>class GovspeakController < ActionController::Base
  def preview
    if params[:govspeak]
      doc = Govspeak::Document.new params[:govspeak]

      respond_to do |format|
        format.json { render json: {govspeak: doc.to_html.to_s} }
      end
    else
      render nothing: true, status: :no_content
    end
  end
end

<commit_msg>The frontend sanitizes the govspeak do the same on the admin<commit_after>class GovspeakController < ActionController::Base
  def preview
    if params[:govspeak]
      doc = Govspeak::Document.new params[:govspeak]

      respond_to do |format|
        format.json { render json: {govspeak: doc.to_sanitized_html.to_s} }
      end
    else
      render nothing: true, status: :no_content
    end
  end
end


{'fraction_non_alphanumeric': 0.08168642951251646, 'fraction_numerical': 0.0, 'mean_word_length': 3.1530054644808745, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 3, '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': '2123146', 'n_tokens_mistral': 249, 'n_tokens_neox': 240, 'n_words': 66}