Lines Matching defs:code
46 // Define the root directory for the GeSHi code tree
76 /** Use a pre to wrap lines when line numbers are enabled or to wrap the whole code. */
83 * <tbody><tr><td><pre>$linenumbers</pre></td><td><pre>$code></pre></td></tr></tbody>
258 * The source code to highlight
341 * The time it took to parse the code
378 * The styles for hyperlinks in the code
392 * Styles for important parts of the code
398 var $important_styles = 'font-weight: bold; color: red;'; // Styles for important parts of the code
401 * Whether CSS IDs should be added to the code
439 * The overall style for this code block
445 * The style for the actual code
451 * The overall class for this code block
457 * The overall ID for this code block
550 * The /e modifier inside <code>preg_replace()</code> allows code execution.
551 * Often it is the cause for remote code execution exploits. It is wise to
554 * use <code>preg_replace_callback()</code> instead
580 * @param string The source code to highlight
620 return "<br /><strong>GeSHi Error:</strong> $msg (code {$this->error})<br />";
640 * Sets the source code for this object
642 * @param string The source code to highlight
664 //Clean up the language name to prevent malicious code injection
735 * If GESHI_HEADER_DIV is used, the code is surrounded in a "div".This
736 * means more source code but more control over tab width and line-wrapping.
740 * From 1.0.7.2, you can use GESHI_HEADER_NONE to specify that no header code
759 * Sets the styles for the code that will be outputted
763 * @param string The overall style for the outputted code block
776 * Sets the overall classname for this block of code. This
780 * @param string The class name to use for this block of code
788 * Sets the overall id for this block of code. This id can then
791 * @param string The ID to use for this block of code
810 * Sets the style for the actual code. This should be a string
817 * code will have the same style as the line number! Consult the
820 * @param string The style to use for actual code
891 * the code in an ordered list.
1595 * the highlighted code or not
1618 * Sets styles for links in code
1630 * Sets the target for links in code
1632 * @param string The target for links in the code, e.g. _blank
1644 * Sets styles for important parts of the code
1646 * @param string The styles to use on important parts of the code
2002 * Returns the code in $this->source, highlighted and surrounded by the
2036 $code = str_replace("\r\n", "\n", $this->source);
2037 $code = str_replace("\r", "\n", $code);
2040 // $code = "\n" . $code . "\n";
2043 $length = strlen($code);
2055 // Break the source into bits. Each bit will be a portion of the code
2075 'open' => $open, // needed for grouping of adjacent code blocks (see below)
2085 $open_pos = strpos($code, $open, $i);
2096 strpos($code, $close, $matches[$dk][$open]['next_match']+1);
2111 preg_match($delimiters, $code, $matches_rx, PREG_OFFSET_CAPTURE, $i)) {
2134 1 => substr($code, $i, $next_match_pos - $i)
2143 // highlightable code
2151 $close_pos = strpos($code, $next_match_pointer['close'], $i);
2159 if ($code[$i] == $next_match_pointer['open'][0] && ($next_match_pointer['open_strlen'] == 1 ||
2160 substr($code, $i, $next_match_pointer['open_strlen']) == $next_match_pointer['open'])) {
2181 $parts[$k][1] = substr($code, $next_match_pos);
2185 $parts[$k][1] = substr($code, $next_match_pos, $i - $next_match_pos);
2194 // if we have a "maybe" strict language, this should be handled as highlightable code
2218 1 => $code
2225 unset($code);
2271 // code that shouldn't be highlighted, and odd-indexed parts should
2289 // get the class key for this block of code
2308 // Now, highlight the code in this block. This code
2526 //This code tries to work around SF#2037598 ...
2720 // Short-cut through all the multiline code
2806 // Short-cut through all the multiline code
2968 * the code is in a pre block...
3524 * Sets the time taken to parse the code
3538 * Gets the time taken to parse the code
3540 * @return double The time taken to parse the code
3633 // for BenBE and future code reviews:
3686 * Takes the parsed code and various options, and creates the HTML
3689 * @param string The code already parsed (reference!)
3695 // This is BUGGY!! My fault for bad code: fix coming in 1.2
3717 // Get code into lines
3719 $code = explode("\n", $parsed_code);
3733 for ($i = 0, $n = count($code); $i < $n;) {
3739 if ('' == trim($code[$i])) {
3740 $code[$i] = ' ';
3756 // code on that line
3807 $parsed_code .= "<li$attr_string>$start{$code[$i-1]}$end</li>$ls";
3808 unset($code[$i - 1]);
3811 $n = count($code);
3843 // code on that line
3874 // Have to use divs so the full width of the code is highlighted
3879 if ('' == trim($code[$i])) {
3880 $code[$i] = ' ';
3891 // code on that line
3911 $parsed_code .= $code[$i];
3920 unset($code[$i]);
3935 * Creates the header for the code block (with correct attributes)
3937 * @return string The header for the code block
4015 * Returns the footer for the code block.
4017 * @return string The footer for the code block
4124 * characters to be replaced could exist at different code points in
4194 * Returns a stylesheet for the highlighted code. If $economy mode
4196 * this code block instead of the whole thing
4423 * <code>$list = array('faa', 'foo', 'foobar');
4424 * => string 'f(aa|oo(bar)?)'</code>
4594 * @param string The code to highlight
4595 * @param string The language to highlight the code in
4599 * @return string The code highlighted (if $return is true)
4607 return '<code>' . $geshi->parse_code() . '</code>';
4610 echo '<code>' . $geshi->parse_code() . '</code>';