public function code($code, $lang = null, $escaped = null) { if ($this->options['highlight']) { $out = $this->options['highlight']($code, $lang); if ($out != null && $out !== $code) { $escaped = true; $code = $out; } } $class = $lang ? ' class="' . $this->options['langPrefix'] . Markdown::escape($lang, true) . '"' : ''; $code = $escaped ? $code : Markdown::escape($code, true); return "<pre><code{$class}>{$code}\n</code></pre>\n"; }
/** * * Escapes HTML in source text. * * @param string $text Source text. * * @param int $quotes A PHP entities constant, default ENT_COMPAT. * * @return string The escaped text. * */ protected function _escape($text, $quotes = ENT_COMPAT) { return $this->_markdown->escape($text, $quotes); }