<commit_before><?php
/**
 * phpDocumentor
 *
 * PHP Version 5.3
 *
 * @copyright 2010-2012 <NAME> / Naenius (http://www.naenius.com)
 * @license   http://www.opensource.org/licenses/mit-license.php MIT
 * @link      http://phpdoc.org
 */

namespace phpDocumentor\Plugin\Core\Xslt;

/**
 * XSLT filters that can be used inside a template.
 */
class Filter
{
    /**
     * Markdown filter.
     *
     * Example usage inside template would be:
     * ```
     * <div class="long_description">
     *     <xsl:value-of select="php:function('phpDocumentor\Plugin\Core\Xslt\Filter::markdown', string(docblock/long-description))" disable-output-escaping="yes" />
     * </div>
     * ```
     *
     * @param string $text
     *
     * @return string
     */
    public static function markdown($text)
    {
        if (!is_string($text)) {
            return $text;
        }

        $parser = new \dflydev\markdown\MarkdownParser();

        return $parser->transform($text);
    }
}<commit_msg>use parsedown<commit_after><?php
/**
 * phpDocumentor
 *
 * PHP Version 5.3
 *
 * @copyright 2010-2012 <NAME> / Naenius (http://www.naenius.com)
 * @license   http://www.opensource.org/licenses/mit-license.php MIT
 * @link      http://phpdoc.org
 */

namespace phpDocumentor\Plugin\Core\Xslt;

/**
 * XSLT filters that can be used inside a template.
 */
class Extension
{
    /**
     * Markdown filter.
     *
     * Example usage inside template would be:
     * ```
     * <div class="long_description">
     *     <xsl:value-of select="php:function('phpDocumentor\Plugin\Core\Xslt\Extension::markdown', string(docblock/long-description))" disable-output-escaping="yes" />
     * </div>
     * ```
     *
     * @param string $text
     *
     * @return string
     */
    public static function markdown($text)
    {
        if (!is_string($text)) {
            return $text;
        }

        $markdown = \Parsedown::instance();

        return $markdown->parse($text);
    }
}
{'fraction_non_alphanumeric': 0.1548582995951417, 'fraction_numerical': 0.010121457489878543, 'mean_word_length': 2.4027538726333906, 'pattern_counts': {'":': 0, '<': 13, '<?xml version=': 0, '>': 13, 'https://': 0, 'lorem ipsum': 0, 'www.': 4, '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': '818922', 'n_tokens_mistral': 659, 'n_tokens_neox': 630, 'n_words': 122}