<commit_before># ~*~ encoding: utf-8 ~*~

class Gollum::Filter::Render < Gollum::Filter
  def extract(data)
    begin
      data = GitHub::Markup.render(@markup.name, data)
      if data.nil?<commit_msg>Chdir to page's directory before rendering. Resolves #170 (#331)<commit_after># ~*~ encoding: utf-8 ~*~

class Gollum::Filter::Render < Gollum::Filter
  def extract(data)
    begin
      working_dir = Pathname.new(@markup.wiki.path).join(@markup.dir)
      working_dir = working_dir.exist? ? working_dir.to_s : '.'
      Dir.chdir(working_dir) do
        data = GitHub::Markup.render(@markup.name, data)
      end
      if data.nil?
{'fraction_non_alphanumeric': 0.14803149606299212, 'fraction_numerical': 0.012598425196850394, 'mean_word_length': 3.608695652173913, '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': '2990688', 'n_tokens_mistral': 229, 'n_tokens_neox': 215, 'n_words': 43}