<commit_before># frozen_string_literal: true

module ApplicationHelper
  include DateAndTimeParser

  def simple_check(checked)
    content_tag(:i, "", class: "fa #{checked ? "fa-check-square-o" : "fa-square-o"}")
  end

  def simple_bold(text)
    text.to_s.gsub(/\*\*(.*?)\*\*/, "<strong>\\1</strong>").html_safe
  end

  # TODO: Remove references to page_content
  def page_content(name)
    YAML.load_file(Rails.root.join('lib', 'data', 'content', "#{name}.yml"))[name]
  end
end<commit_msg>Rewrote simple_bold method using sanitize<commit_after># frozen_string_literal: true

# Generic methods uses across the application views.
module ApplicationHelper
  include DateAndTimeParser

  def simple_check(checked)
    content_tag(:i, "", class: "fa #{checked ? "fa-check-square-o" : "fa-square-o"}")
  end

  def simple_bold(text)
    sanitize(text.to_s.gsub(/\*\*(.*?)\*\*/, "<strong>\\1</strong>"), tags: %w(strong))
  end
end
{'fraction_non_alphanumeric': 0.17419354838709677, 'fraction_numerical': 0.002150537634408602, 'mean_word_length': 4.508875739644971, 'pattern_counts': {'":': 0, '<': 7, '<?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': '4101891', 'n_tokens_mistral': 330, 'n_tokens_neox': 318, 'n_words': 68}