<commit_before>module PagesHelper
  
  def wikified_body(body)
    r = RedCloth.new(body)
    r.gsub!(/\[\[(.*)\]\]/) {wiki_link($1)}
    r.to_html
  end
  
  def wiki_link(wiki_words)
    permalink = wiki_words.downcase.gsub(' ', '-')
    if Page.exists?(:permalink => permalink)
      link_to wiki_words, wiki_page_url(permalink)
    else
      link_to wiki_words, wiki_page_url(permalink), :class => "new_wiki_link" 
    end
  end
  
  def current_revision(id, version)
    version == Page.find(id).version
  end
  
  def body_input(f)
    if site.disable_teh
      f.text_area :body
    else
      textile_editor 'page', 'body'
    end
  end
  
end<commit_msg>Adding mrneighborly's wiki words link name patch.<commit_after>module PagesHelper
  
  def wikified_body(body)
    r = RedCloth.new(body)
    r.gsub!(/\[\[(.*)(\|(.*))?\]\]/) {wiki_link(*$1.split("|"))}
    r.to_html
  end
  
  def wiki_link(wiki_words, link_text = nil)
    permalink = wiki_words.downcase.gsub(' ', '-')
    if Page.exists?(:permalink => permalink)
      link_to ((link_text || wiki_words), wiki_page_url(permalink))
    else
      link_to ((link_text || wiki_words), wiki_page_url(permalink), :class => "new_wiki_link")
    end
  end
  
  def current_revision(id, version)
    version == Page.find(id).version
  end
  
  def body_input(f)
    if site.disable_teh
      f.text_area :body
    else
      textile_editor 'page', 'body'
    end
  end
  
end
{'fraction_non_alphanumeric': 0.13937282229965156, 'fraction_numerical': 0.0013937282229965157, 'mean_word_length': 3.0, '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': '4367837', 'n_tokens_mistral': 570, 'n_tokens_neox': 548, 'n_words': 103}