/** * Constructor. Assigns the GeSHiStyler object to use * * @param GeSHiStyler The styler oject to use */ function __construct($language) { $this->_styler = geshi_styler(); $this->_language = $language; }
/** * Recieves the result string from GeSHiStyler. The result string will * have gone through the renderer and so be ready to use. * * This method makes sure error cases are handled, and frees any memory * used by the parse run * * @return The code, post-processed. */ protected function _parsePostProcess() { // @todo [blocking 1.1.5] (bug 5) Evaluate feasability and get working if possible the functionality below... //$result = preg_replace('#([^"])(((https?)|(ftp))://[a-z0-9\-]+\.([a-z0-9\-\.]+)+/?([a-zA-Z0-9\.\-_%]+/?)*\??([a-zA-Z0-9=&\[\];%]+)?(\#[a-zA-Z0-9\-_]+)?)#', '\\1<a href="\\2">\\2</a>', $result); //$result = preg_replace('#([a-z0-9\._\-]+@[[a-z0-9\-\.]+[a-z]+)#si', '<a href="mailto:\\1">\\1</a>', $result); // Destroy root context, we don't need it anymore $this->_rootContext = null; // Get code $code = $this->_styler->getParsedCode(); // Trash the old GeSHiStyler $this->_styler = geshi_styler(true); return $code; }
/** * Constructor. */ function __construct() { $this->_styler = geshi_styler(); }
/** * Creates a new GeSHiContext. * * @param string The name of the language this context represents * @param string An initialisation function * @todo [blocking 1.1.9] Better comment */ function __construct($context_name, $init_function = '') { $this->_contextName = $context_name; $this->_languageName = substr($context_name, 0, strpos($context_name, '/')); $this->_styler = geshi_styler(); }