<commit_before><?php

    define('TEMPLATE_PATH', realpath(__DIR__) . '/../templates/');

    function getBlock($location) {

        ob_start();
        include(TEMPLATE_PATH . $location . '.php');
        $contents = ob_get_contents();
        ob_end_clean();

        $contents = preg_replace_callback('|{% highlight code %}([^{]+){% end highlight code %}|s', function($matches) {
            return '<pre class="primer-code"><code class="html">' . htmlspecialchars(trim($matches[1])) . '</code></pre>';
        }, $contents);

        return $contents;
    }<commit_msg>Syntax Highlighter Function: we have the right Regex now.<commit_after><?php

    define('TEMPLATE_PATH', realpath(__DIR__) . '/../templates/');

    function getBlock($location) {

        ob_start();
        include(TEMPLATE_PATH . $location . '.php');
        $contents = ob_get_contents();
        ob_end_clean();

        $contents = preg_replace_callback('|{% highlight html %}(.+?(?={%)){% end highlight html %}|s', function($matches) {
            return '<pre class="primer-code"><code class="html">' . htmlspecialchars(trim($matches[1])) . '</code></pre>';
        }, $contents);
        
        $contents = preg_replace_callback('|{% highlight css %}(.+?(?={%)){% end highlight css %}|s', function($matches) {
            return '<pre class="primer-code"><code class="css">' . htmlspecialchars(trim($matches[1])) . '</code></pre>';
        }, $contents);
        


        
        return $contents;
    }
{'fraction_non_alphanumeric': 0.19772117962466487, 'fraction_numerical': 0.0020107238605898124, 'mean_word_length': 2.9602122015915118, 'pattern_counts': {'":': 0, '<': 17, '<?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': '3990308', 'n_tokens_mistral': 442, 'n_tokens_neox': 426, 'n_words': 86}