<commit_before>module PetitionsHelper
  
  def social_media_config
    Rails.configuration.social_media
  end

  def find_member_by_id_hash(hash)
    member_id = MemberHasher.validate(hash)
    member = Member.find member_id unless not member_id
  end

  def petition_to_open_graph(petition, member=nil)
    { 
      'og:title' => petition.experiments.facebook(member).title,
      'og:type' => 'watchdognet:petition',
      'og:description' => strip_tags_except_links(petition.facebook_description_for_sharing).squish[0..300],
      'og:image' => petition.experiments.facebook(member).image,
      'og:site_name' => social_media_config[:facebook][:site_name],
      'fb:app_id' => social_media_config[:facebook][:app_id]
    }
  end
<commit_msg>fixed HTML encoding of petition opengraph description<commit_after>module PetitionsHelper
  
  def social_media_config
    Rails.configuration.social_media
  end

  def find_member_by_id_hash(hash)
    member_id = MemberHasher.validate(hash)
    member = Member.find member_id unless not member_id
  end

  def petition_to_open_graph(petition, member=nil)
    { 
      'og:title' => petition.experiments.facebook(member).title,
      'og:type' => 'watchdognet:petition',
      'og:description' => h(strip_tags_except_links(petition.facebook_description_for_sharing).squish[0..300]),
      'og:image' => petition.experiments.facebook(member).image,
      'og:site_name' => social_media_config[:facebook][:site_name],
      'fb:app_id' => social_media_config[:facebook][:app_id]
    }
  end

{'fraction_non_alphanumeric': 0.11465798045602606, 'fraction_numerical': 0.005211726384364821, 'mean_word_length': 4.710037174721189, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 15, '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': '4204154', 'n_tokens_mistral': 512, 'n_tokens_neox': 494, 'n_words': 72}