<commit_before><?php

class CM_Usertext_Markdown extends Michelf\MarkdownExtra {

    protected $id_class_attr_catch_re = '\{((?:[ ]*[#.][-_:a-zA-Z0-9]+){0,2}(?:[ ]*\$[\d]+x[\d]+))[ ]*\}';
    protected $id_class_attr_nocatch_re = '\{(?:[ ]*[#.][-_:a-zA-Z0-9]+){0,2}(?:[ ]*\$[\d]+x[\d]+)[ ]*\}';

    /** @var bool $_skipAnchors */
    private $_skipAnchors;

    /**
     * @param bool|null $skipAnchors
     */
    public function __construct($skipAnchors = null) {
        $this->_skipAnchors = (boolean) $skipAnchors;
        parent::__construct();
    }

    protected function formParagraphs($text) {
        $text = preg_replace('/\A\n+|\n+\z/', '', $text);
        $grafs = preg_split('/\n{1,}/', $text, -1, PREG_SPLIT_NO_EMPTY);

        foreach ($grafs as $key => $value) {
            if (!preg_match('/^B\x1A[0-9]+B$/', $value)) {
                # Is a paragraph.
                $value = $this->runSpanGamut($value);
                $value = preg_replace('/^([ ]*)/', "<p>", $value);
                $value .= "</p>";
                $grafs[$key] = $this->unhash($value);
            } else {
                # Is a block.
                # Modify elements of @grafs in-place...
                $graf = $value;
                $block = $this->html_hashes[$graf];
                $graf = $block;
                $grafs[$key] = $graf;
            }
        }
        return implode("\n", $grafs);
    }

    protected function _doAnchors_inline_callback($matches) {
        if (!$this->_skipAnchors) {
            return parent::_doAnchors_inline_callback($matches);
        }
        $link_text = $this->runSpanGamut($matches[2]);
        return $this->hashPart($link_text);
    }

    protected function _doAnchors_reference_callback($matches) {
        if (!$this->_skipAnchors) {
            return parent::_doAnchors_inline_callback($matches);
        }
        $link_text = $matches[2];
        return $link_text;<commit_msg>use correct parent method in reference-anchor callback<commit_after><?php

class CM_Usertext_Markdown extends Michelf\MarkdownExtra {

    protected $id_class_attr_catch_re = '\{((?:[ ]*[#.][-_:a-zA-Z0-9]+){0,2}(?:[ ]*\$[\d]+x[\d]+))[ ]*\}';
    protected $id_class_attr_nocatch_re = '\{(?:[ ]*[#.][-_:a-zA-Z0-9]+){0,2}(?:[ ]*\$[\d]+x[\d]+)[ ]*\}';

    /** @var bool $_skipAnchors */
    private $_skipAnchors;

    /**
     * @param bool|null $skipAnchors
     */
    public function __construct($skipAnchors = null) {
        $this->_skipAnchors = (boolean) $skipAnchors;
        parent::__construct();
    }

    protected function formParagraphs($text) {
        $text = preg_replace('/\A\n+|\n+\z/', '', $text);
        $grafs = preg_split('/\n{1,}/', $text, -1, PREG_SPLIT_NO_EMPTY);

        foreach ($grafs as $key => $value) {
            if (!preg_match('/^B\x1A[0-9]+B$/', $value)) {
                # Is a paragraph.
                $value = $this->runSpanGamut($value);
                $value = preg_replace('/^([ ]*)/', "<p>", $value);
                $value .= "</p>";
                $grafs[$key] = $this->unhash($value);
            } else {
                # Is a block.
                # Modify elements of @grafs in-place...
                $graf = $value;
                $block = $this->html_hashes[$graf];
                $graf = $block;
                $grafs[$key] = $graf;
            }
        }
        return implode("\n", $grafs);
    }

    protected function _doAnchors_inline_callback($matches) {
        if (!$this->_skipAnchors) {
            return parent::_doAnchors_inline_callback($matches);
        }
        $link_text = $this->runSpanGamut($matches[2]);
        return $this->hashPart($link_text);
    }

    protected function _doAnchors_reference_callback($matches) {
        if (!$this->_skipAnchors) {
            return parent::_doAnchors_reference_callback($matches);
        }
        $link_text = $matches[2];
        return $link_text;
{'fraction_non_alphanumeric': 0.19363867684478372, 'fraction_numerical': 0.007633587786259542, 'mean_word_length': 2.0952755905511813, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 25, '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': '224293', 'n_tokens_mistral': 1363, 'n_tokens_neox': 1325, 'n_words': 211}