public function render($code) { // Normalize line breaks. $this->_code = preg_replace('/\\r\\n?/', "\n", $code); $fm = hyperlight_calculate_fold_marks($this->_code, $this->language()->id()); return hyperlight_apply_fold_marks($this->renderCode(), $fm); }
public function render($code) { if (false === $this->language()) { $this->_lang = HyperLanguage::compileFromName('code'); $this->reset(); if (!$this->language()) { return htmlspecialchars($code); } } // Normalize line breaks. $this->_code = preg_replace('/\\r\\n?/', "\n", $code); $fm = hyperlight_calculate_fold_marks($this->_code, $this->language()->id()); return hyperlight_apply_fold_marks($this->renderCode(), $fm); }