Lines Matching refs:code

45 // Define the root directory for the GeSHi code tree
75 /** Use a pre to wrap lines when line numbers are enabled or to wrap the whole code. */
82 * <tbody><tr><td><pre>$linenumbers</pre></td><td><pre>$code></pre></td></tr></tbody>
229 * The source code to highlight
312 * The time it took to parse the code
349 * The styles for hyperlinks in the code
363 * Styles for important parts of the code
369 protected $important_styles = 'font-weight: bold; color: red;'; // Styles for important parts of the code
372 * Whether CSS IDs should be added to the code
410 * The overall style for this code block
416 * The style for the actual code
422 * The overall class for this code block
428 * The overall ID for this code block
521 * The /e modifier inside <code>preg_replace()</code> allows code execution.
522 * Often it is the cause for remote code execution exploits. It is wise to
525 * use <code>preg_replace_callback()</code> instead
549 * @param string $source The source code to highlight
600 return "<br /><strong>GeSHi Error:</strong> $msg (code {$this->error})<br />";
620 * Sets the source code for this object
622 * @param string $source The source code to highlight
631 * Clean up the language name to prevent malicious code injection
661 //Clean up the language name to prevent malicious code injection
782 //Clean up the language name to prevent malicious code injection
809 * If GESHI_HEADER_DIV is used, the code is surrounded in a "div".This
810 * means more source code but more control over tab width and line-wrapping.
814 * From 1.0.7.2, you can use GESHI_HEADER_NONE to specify that no header code
833 * Sets the styles for the code that will be outputted
837 * @param string $style The overall style for the outputted code block
850 * Sets the overall classname for this block of code. This
854 * @param string $class The class name to use for this block of code
862 * Sets the overall id for this block of code. This id can then
865 * @param string $id The ID to use for this block of code
884 * Sets the style for the actual code. This should be a string
891 * code will have the same style as the line number! Consult the
894 * @param string $style The style to use for actual code
965 * the code in an ordered list.
1204 * Sets the styles for strict code blocks. If $preserve_defaults is
1730 * the highlighted code or not
1753 * Sets styles for links in code
1765 * Sets the target for links in code
1767 * @param string $target The target for links in the code, e.g. _blank
1779 * Sets styles for important parts of the code
1781 * @param string $styles The styles to use on important parts of the code
2150 * Returns the code in $this->source, highlighted and surrounded by the
2164 $code = str_replace("\r\n", "\n", $this->source);
2165 $code = str_replace("\r", "\n", $code);
2193 $length = strlen($code);
2205 // Break the source into bits. Each bit will be a portion of the code
2225 'open' => $open, // needed for grouping of adjacent code blocks (see below)
2235 $open_pos = strpos($code, $open, $i);
2246 strpos($code, $close, $matches[$dk][$open]['next_match']+1);
2260 if(preg_match($delimiters, $code, $matches_rx, PREG_OFFSET_CAPTURE, $i)) {
2295 1 => substr($code, $i, $next_match_pos - $i)
2304 // highlightable code
2312 $close_pos = strpos($code, $next_match_pointer['close'], $i);
2320 if ($code[$i] == $next_match_pointer['open'][0] && ($next_match_pointer['open_strlen'] == 1 ||
2321 substr($code, $i, $next_match_pointer['open_strlen']) == $next_match_pointer['open'])) {
2342 $parts[$k][1] = substr($code, $next_match_pos);
2346 $parts[$k][1] = substr($code, $next_match_pos, $i - $next_match_pos);
2355 // if we have a "maybe" strict language, this should be handled as highlightable code
2379 1 => $code
2386 unset($code);
2432 // code that shouldn't be highlighted, and odd-indexed parts should
2450 // get the class key for this block of code
2469 // Now, highlight the code in this block. This code
2673 //This code tries to work around SF#2037598 ...
2868 // Short-cut through all the multiline code
2954 // Short-cut through all the multiline code
3116 * the code is in a pre block...
3662 * Sets the time taken to parse the code
3675 * Gets the time taken to parse the code
3677 * @return double The time taken to parse the code
3768 // for BenBE and future code reviews:
3821 * Takes the parsed code and various options, and creates the HTML
3824 * @param string $parsed_code The code already parsed (reference!)
3829 // This is BUGGY!! My fault for bad code: fix coming in 1.2
3851 // Get code into lines
3853 $code = explode("\n", $parsed_code);
3864 for ($i = 0, $n = count($code); $i < $n;) {
3870 if ('' == trim($code[$i])) {
3871 $code[$i] = '&nbsp;';
3887 // code on that line
3938 $parsed_code .= "<li$attr_string>$start{$code[$i-1]}$end</li>$ls";
3939 unset($code[$i - 1]);
3942 $n = count($code);
3974 // code on that line
4005 // Have to use divs so the full width of the code is highlighted
4010 if ('' == trim($code[$i])) {
4011 $code[$i] = '&nbsp;';
4022 // code on that line
4042 $parsed_code .= $code[$i];
4051 unset($code[$i]);
4066 * Creates the header for the code block (with correct attributes)
4068 * @return string The header for the code block
4145 * Returns the footer for the code block.
4147 * @return string The footer for the code block
4252 * characters to be replaced could exist at different code points in
4333 * Returns a stylesheet for the highlighted code. If $economy mode
4335 * this code block instead of the whole thing
4560 * <code>$list = array('faa', 'foo', 'foobar');
4561 * => string 'f(aa|oo(bar)?)'</code>
4735 * @param string $string The code to highlight
4736 * @param string $language The language to highlight the code in
4740 * @return string The code highlighted (if $return is true)
4748 return '<code>' . $geshi->parse_code() . '</code>';
4751 echo '<code>' . $geshi->parse_code() . '</code>';