AdminPageFramework_Parsedown::text PHP Метод

text() публичный Метод

public text ( $text )
    function text($text)
    {
        $this->DefinitionData = array();
        $text = str_replace(array("\r\n", "\r"), "\n", $text);
        $text = trim($text, "\n");
        $lines = explode("\n", $text);
        $markup = $this->lines($lines);
        $markup = trim($markup, "\n");
        return $markup;
    }

Usage Example

 private function _getParsedText($sContent)
 {
     $_sContent = preg_replace('/`(.*?)`/', '<code>\\1</code>', $sContent);
     $_sContent = preg_replace_callback('/`(.*?)`/ms', array($this, '_replyToReplaceCodeBlocks'), $_sContent);
     $_sContent = preg_replace('/= (.*?) =/', '<h4>\\1</h4>', $_sContent);
     $_sContent = str_replace(array_keys($this->aReplacements), array_values($this->aReplacements), $_sContent);
     $_oParsedown = new AdminPageFramework_Parsedown();
     return $_oParsedown->text($_sContent);
 }