<commit_before><?php

class GoogleCodePrettify {
  private static $prettified = false;
  
  public static function parserHook($text, $args = array(), $parser) {
    $code_attributes = '';
    if (isset($args['lang']) && $args['lang']) {
      $lang = $args['lang'];
      $code_attributes .= " class=\"language-$lang\"";
    }
    self::$prettified = true;

    return "<pre class=\"prettyprint\"><code$code_attributes>$text</code></pre>";
  }

  public static function beforePageDisplay(&$wgOut, &$sk) {
    if (self::$prettified) {
      $wgOut->addModules('ext.GoogleCodePrettify');
    }

    // Continue
    return true;
  }
}
<commit_msg>Use pre tag only without code to meet MediaWiki styling<commit_after><?php

class GoogleCodePrettify {
  private static $prettified = false;
  
  public static function parserHook($text, $args = array(), $parser) {
    $pre_classes = '';
    if (isset($args['lang']) && $args['lang']) {
      $lang = $args['lang'];
      $pre_classes .= " lang-$lang";
    }
    self::$prettified = true;

    return "<pre class=\"prettyprint$pre_classes\">$text</pre>";
  }

  public static function beforePageDisplay(&$wgOut, &$sk) {
    if (self::$prettified) {
      $wgOut->addModules('ext.GoogleCodePrettify');
    }

    // Continue
    return true;
  }
}

{'fraction_non_alphanumeric': 0.17660728117738186, 'fraction_numerical': 0.0, 'mean_word_length': 3.4705882352941178, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 11, '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': '2458620', 'n_tokens_mistral': 427, 'n_tokens_neox': 417, 'n_words': 85}