Source for file Code.php
Documentation is available at Code.php
class Text_Wiki_Render_Xhtml_Code extends Text_Wiki_Render {
* Renders a token into text matching the requested format.
* @param array $options The "options" portion of the token (second
* @return string The text rendered from the token options.
$text = $options['text'];
$attr = $options['attr'];
$text = "<?php\n" . $options['text'] . "\n?>"; // <?php
// convert tabs to four spaces
// colorize the code block (also converts HTML entities and adds
// <code>...</code> tags)
// replace <br /> tags with simple newlines
//$text = str_replace("<br />", "\n", $text);
// replace non-breaking space with simple spaces
//$text = str_replace(" ", " ", $text);
// replace <br /> tags with simple newlines
// replace non-breaking space with simple spaces
// translate old HTML to new XHTML
// courtesy of research by A. Kalin :-)
'color="' => 'style="color:'
$text = strtr($text, $map);
// get rid of the last newline inside the code block
// (becuase higlight_string puts one there)
if (substr($text, -8 ) == "\n</code>") {
$text = substr($text, 0 , -8 ) . "</code>";
$text = " <pre>$text</pre>";
// add <html> opening and closing tags,
// convert tabs to four spaces,
$text = " <html>\n$text\n</html>";
$text = " <pre><code>$text</code></pre>";
// convert tabs to four spaces,
$text = " <pre><code>$text</code></pre>";
Documentation generated on Mon, 11 Mar 2019 13:51:28 -0400 by phpDocumentor 1.4.4. PEAR Logo Copyright © PHP Group 2004.
|