author | Dan |
Fri, 29 May 2009 19:55:36 -0400 | |
changeset 5 | bfe00fc686f2 |
parent 4 | 97d85c22ced7 |
child 6 | aeecc46f11c6 |
permissions | -rwxr-xr-x |
1
c715631f809a
First working commit. Works using <code type="whatvever">...</code>. Supports all languages supported by default in GeSHi
Dan
parents:
0
diff
changeset
|
1 |
<?php |
c715631f809a
First working commit. Works using <code type="whatvever">...</code>. Supports all languages supported by default in GeSHi
Dan
parents:
0
diff
changeset
|
2 |
/* |
c715631f809a
First working commit. Works using <code type="whatvever">...</code>. Supports all languages supported by default in GeSHi
Dan
parents:
0
diff
changeset
|
3 |
Plugin Name: GeSHi syntax highlighting |
c715631f809a
First working commit. Works using <code type="whatvever">...</code>. Supports all languages supported by default in GeSHi
Dan
parents:
0
diff
changeset
|
4 |
Plugin URI: http://enanocms.org/GeSHi_support |
c715631f809a
First working commit. Works using <code type="whatvever">...</code>. Supports all languages supported by default in GeSHi
Dan
parents:
0
diff
changeset
|
5 |
Description: Adds syntax highlighting support using the GeSHi engine. |
c715631f809a
First working commit. Works using <code type="whatvever">...</code>. Supports all languages supported by default in GeSHi
Dan
parents:
0
diff
changeset
|
6 |
Author: Dan Fuhry |
c715631f809a
First working commit. Works using <code type="whatvever">...</code>. Supports all languages supported by default in GeSHi
Dan
parents:
0
diff
changeset
|
7 |
Version: 0.1 |
c715631f809a
First working commit. Works using <code type="whatvever">...</code>. Supports all languages supported by default in GeSHi
Dan
parents:
0
diff
changeset
|
8 |
Author URI: http://enanocms.org/ |
c715631f809a
First working commit. Works using <code type="whatvever">...</code>. Supports all languages supported by default in GeSHi
Dan
parents:
0
diff
changeset
|
9 |
*/ |
c715631f809a
First working commit. Works using <code type="whatvever">...</code>. Supports all languages supported by default in GeSHi
Dan
parents:
0
diff
changeset
|
10 |
|
c715631f809a
First working commit. Works using <code type="whatvever">...</code>. Supports all languages supported by default in GeSHi
Dan
parents:
0
diff
changeset
|
11 |
/* |
c715631f809a
First working commit. Works using <code type="whatvever">...</code>. Supports all languages supported by default in GeSHi
Dan
parents:
0
diff
changeset
|
12 |
* GeSHi highlighting plugin for Enano |
c715631f809a
First working commit. Works using <code type="whatvever">...</code>. Supports all languages supported by default in GeSHi
Dan
parents:
0
diff
changeset
|
13 |
* Version 0.1 |
c715631f809a
First working commit. Works using <code type="whatvever">...</code>. Supports all languages supported by default in GeSHi
Dan
parents:
0
diff
changeset
|
14 |
* Copyright (C) 2007 Dan Fuhry |
c715631f809a
First working commit. Works using <code type="whatvever">...</code>. Supports all languages supported by default in GeSHi
Dan
parents:
0
diff
changeset
|
15 |
* |
c715631f809a
First working commit. Works using <code type="whatvever">...</code>. Supports all languages supported by default in GeSHi
Dan
parents:
0
diff
changeset
|
16 |
* This program is Free Software; you can redistribute and/or modify it under the terms of the GNU General Public License |
c715631f809a
First working commit. Works using <code type="whatvever">...</code>. Supports all languages supported by default in GeSHi
Dan
parents:
0
diff
changeset
|
17 |
* as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. |
c715631f809a
First working commit. Works using <code type="whatvever">...</code>. Supports all languages supported by default in GeSHi
Dan
parents:
0
diff
changeset
|
18 |
* |
c715631f809a
First working commit. Works using <code type="whatvever">...</code>. Supports all languages supported by default in GeSHi
Dan
parents:
0
diff
changeset
|
19 |
* This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied |
c715631f809a
First working commit. Works using <code type="whatvever">...</code>. Supports all languages supported by default in GeSHi
Dan
parents:
0
diff
changeset
|
20 |
* warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for details. |
c715631f809a
First working commit. Works using <code type="whatvever">...</code>. Supports all languages supported by default in GeSHi
Dan
parents:
0
diff
changeset
|
21 |
*/ |
c715631f809a
First working commit. Works using <code type="whatvever">...</code>. Supports all languages supported by default in GeSHi
Dan
parents:
0
diff
changeset
|
22 |
|
c715631f809a
First working commit. Works using <code type="whatvever">...</code>. Supports all languages supported by default in GeSHi
Dan
parents:
0
diff
changeset
|
23 |
global $db, $session, $paths, $template, $plugins; // Common objects |
c715631f809a
First working commit. Works using <code type="whatvever">...</code>. Supports all languages supported by default in GeSHi
Dan
parents:
0
diff
changeset
|
24 |
$GLOBALS['geshi_supported_formats'] = array( |
2 | 25 |
'abap', 'actionscript3', 'actionscript', 'ada', 'apache', 'applescript', 'apt_sources', 'asm', 'asp', 'autoit', 'avisynth', 'bash', 'basic4gl', 'bf', 'blitzbasic', 'bnf', 'boo', 'caddcl', 'cadlisp', 'cfdg', 'cfm', 'cil', 'c_mac', 'cobol', 'c', 'cpp', 'cpp-qt', 'csharp', 'css', 'delphi', 'diff', 'div', 'dos', 'dot', 'd', 'eiffel', 'email', 'fortran', 'freebasic', 'genero', 'gettext', 'glsl', 'gml', 'gnuplot', 'groovy', 'haskell', 'hq9plus', 'html', 'idl', 'ini', 'inno', 'intercal', 'io', 'java5', 'java', 'javascript', 'kixtart', 'klonec', 'klonecpp', 'latex', 'lisp', 'lolcode', 'lotusformulas', 'lotusscript', 'lscript', 'lua', 'm68k', 'make', 'matlab', 'mirc', 'mpasm', 'mxml', 'mysql', 'nsis', 'objc', 'ocaml-brief', 'ocaml', 'oobas', 'oracle11', 'oracle8', 'pascal', 'perl', 'per', 'php-brief', 'php', 'pic16', 'pixelbender', 'plsql', 'povray', 'powershell', 'progress', 'prolog', 'providex', 'python', 'qbasic', 'rails', 'reg', 'robots', 'ruby', 'sas', 'scala', 'scheme', 'scilab', 'sdlbasic', 'smalltalk', 'smarty', 'sql', 'tcl', 'teraterm', 'text', 'thinbasic', 'tsql', 'typoscript', 'vbnet', 'vb', 'verilog', 'vhdl', 'vim', 'visualfoxpro', 'visualprolog', 'whitespace', 'winbatch', 'xml', 'xorg_conf', 'xpp', 'z80' |
1
c715631f809a
First working commit. Works using <code type="whatvever">...</code>. Supports all languages supported by default in GeSHi
Dan
parents:
0
diff
changeset
|
26 |
); |
c715631f809a
First working commit. Works using <code type="whatvever">...</code>. Supports all languages supported by default in GeSHi
Dan
parents:
0
diff
changeset
|
27 |
|
c715631f809a
First working commit. Works using <code type="whatvever">...</code>. Supports all languages supported by default in GeSHi
Dan
parents:
0
diff
changeset
|
28 |
// Knock out the existing <code> tag support |
c715631f809a
First working commit. Works using <code type="whatvever">...</code>. Supports all languages supported by default in GeSHi
Dan
parents:
0
diff
changeset
|
29 |
$plugins->attachHook('text_wiki_construct', 'geshi_disable_tw_code($this);'); |
c715631f809a
First working commit. Works using <code type="whatvever">...</code>. Supports all languages supported by default in GeSHi
Dan
parents:
0
diff
changeset
|
30 |
|
c715631f809a
First working commit. Works using <code type="whatvever">...</code>. Supports all languages supported by default in GeSHi
Dan
parents:
0
diff
changeset
|
31 |
function geshi_disable_tw_code($tw) |
c715631f809a
First working commit. Works using <code type="whatvever">...</code>. Supports all languages supported by default in GeSHi
Dan
parents:
0
diff
changeset
|
32 |
{ |
c715631f809a
First working commit. Works using <code type="whatvever">...</code>. Supports all languages supported by default in GeSHi
Dan
parents:
0
diff
changeset
|
33 |
$tw->disable[] = 'Code'; |
c715631f809a
First working commit. Works using <code type="whatvever">...</code>. Supports all languages supported by default in GeSHi
Dan
parents:
0
diff
changeset
|
34 |
foreach ( $tw->rules as $i => $rule ) |
c715631f809a
First working commit. Works using <code type="whatvever">...</code>. Supports all languages supported by default in GeSHi
Dan
parents:
0
diff
changeset
|
35 |
{ |
c715631f809a
First working commit. Works using <code type="whatvever">...</code>. Supports all languages supported by default in GeSHi
Dan
parents:
0
diff
changeset
|
36 |
if ( $rule == 'Code' ) |
c715631f809a
First working commit. Works using <code type="whatvever">...</code>. Supports all languages supported by default in GeSHi
Dan
parents:
0
diff
changeset
|
37 |
{ |
c715631f809a
First working commit. Works using <code type="whatvever">...</code>. Supports all languages supported by default in GeSHi
Dan
parents:
0
diff
changeset
|
38 |
unset($tw->rules[$i]); |
c715631f809a
First working commit. Works using <code type="whatvever">...</code>. Supports all languages supported by default in GeSHi
Dan
parents:
0
diff
changeset
|
39 |
return true; |
c715631f809a
First working commit. Works using <code type="whatvever">...</code>. Supports all languages supported by default in GeSHi
Dan
parents:
0
diff
changeset
|
40 |
} |
c715631f809a
First working commit. Works using <code type="whatvever">...</code>. Supports all languages supported by default in GeSHi
Dan
parents:
0
diff
changeset
|
41 |
} |
c715631f809a
First working commit. Works using <code type="whatvever">...</code>. Supports all languages supported by default in GeSHi
Dan
parents:
0
diff
changeset
|
42 |
} |
c715631f809a
First working commit. Works using <code type="whatvever">...</code>. Supports all languages supported by default in GeSHi
Dan
parents:
0
diff
changeset
|
43 |
|
c715631f809a
First working commit. Works using <code type="whatvever">...</code>. Supports all languages supported by default in GeSHi
Dan
parents:
0
diff
changeset
|
44 |
// Prevent <code> tags from being stripped or sanitized (the plugin will handle all sanitation) |
c715631f809a
First working commit. Works using <code type="whatvever">...</code>. Supports all languages supported by default in GeSHi
Dan
parents:
0
diff
changeset
|
45 |
$plugins->attachHook('render_sanitize_pre', 'geshi_strip_code($text, $geshi_code_blocks, $random_id);'); |
c715631f809a
First working commit. Works using <code type="whatvever">...</code>. Supports all languages supported by default in GeSHi
Dan
parents:
0
diff
changeset
|
46 |
$plugins->attachHook('render_sanitize_post', 'geshi_restore_code($text, $geshi_code_blocks, $random_id);'); |
c715631f809a
First working commit. Works using <code type="whatvever">...</code>. Supports all languages supported by default in GeSHi
Dan
parents:
0
diff
changeset
|
47 |
|
c715631f809a
First working commit. Works using <code type="whatvever">...</code>. Supports all languages supported by default in GeSHi
Dan
parents:
0
diff
changeset
|
48 |
function geshi_strip_code(&$text, &$codeblocks, $random_id) |
c715631f809a
First working commit. Works using <code type="whatvever">...</code>. Supports all languages supported by default in GeSHi
Dan
parents:
0
diff
changeset
|
49 |
{ |
4 | 50 |
// remove nowiki |
51 |
$nw = preg_match_all('#<nowiki>(.*?)<\/nowiki>#is', $text, $nowiki); |
|
52 |
||
53 |
for ( $i = 0; $i < $nw; $i++ ) |
|
54 |
{ |
|
55 |
$text = str_replace('<nowiki>'.$nowiki[1][$i].'</nowiki>', '{NOWIKI:'.$random_id.':'.$i.'}', $text); |
|
56 |
} |
|
57 |
||
1
c715631f809a
First working commit. Works using <code type="whatvever">...</code>. Supports all languages supported by default in GeSHi
Dan
parents:
0
diff
changeset
|
58 |
global $geshi_supported_formats; |
c715631f809a
First working commit. Works using <code type="whatvever">...</code>. Supports all languages supported by default in GeSHi
Dan
parents:
0
diff
changeset
|
59 |
$codeblocks = array(); |
c715631f809a
First working commit. Works using <code type="whatvever">...</code>. Supports all languages supported by default in GeSHi
Dan
parents:
0
diff
changeset
|
60 |
$sf = '(' . implode('|', $geshi_supported_formats) . ')'; |
2 | 61 |
$regexp = '/<(code|source) (?:type|lang)="?' . $sf . '"?>(.*?)<\/\\1>/s'; |
62 |
preg_match_all($regexp, $text, $matches); |
|
1
c715631f809a
First working commit. Works using <code type="whatvever">...</code>. Supports all languages supported by default in GeSHi
Dan
parents:
0
diff
changeset
|
63 |
|
c715631f809a
First working commit. Works using <code type="whatvever">...</code>. Supports all languages supported by default in GeSHi
Dan
parents:
0
diff
changeset
|
64 |
// for debug |
c715631f809a
First working commit. Works using <code type="whatvever">...</code>. Supports all languages supported by default in GeSHi
Dan
parents:
0
diff
changeset
|
65 |
/* |
c715631f809a
First working commit. Works using <code type="whatvever">...</code>. Supports all languages supported by default in GeSHi
Dan
parents:
0
diff
changeset
|
66 |
if ( strstr($text, '<code type') ) |
2 | 67 |
die('processing codes: <pre>' . htmlspecialchars(print_r($matches, true)) . '</pre><pre>' . htmlspecialchars($text) . '</pre>' . htmlspecialchars($regexp)); |
1
c715631f809a
First working commit. Works using <code type="whatvever">...</code>. Supports all languages supported by default in GeSHi
Dan
parents:
0
diff
changeset
|
68 |
*/ |
c715631f809a
First working commit. Works using <code type="whatvever">...</code>. Supports all languages supported by default in GeSHi
Dan
parents:
0
diff
changeset
|
69 |
|
c715631f809a
First working commit. Works using <code type="whatvever">...</code>. Supports all languages supported by default in GeSHi
Dan
parents:
0
diff
changeset
|
70 |
foreach ( $matches[0] as $i => $match ) |
c715631f809a
First working commit. Works using <code type="whatvever">...</code>. Supports all languages supported by default in GeSHi
Dan
parents:
0
diff
changeset
|
71 |
{ |
c715631f809a
First working commit. Works using <code type="whatvever">...</code>. Supports all languages supported by default in GeSHi
Dan
parents:
0
diff
changeset
|
72 |
$codeblocks[$i] = array( |
c715631f809a
First working commit. Works using <code type="whatvever">...</code>. Supports all languages supported by default in GeSHi
Dan
parents:
0
diff
changeset
|
73 |
'match' => $match, |
2 | 74 |
'lang' => $matches[2][$i], |
75 |
'code' => $matches[3][$i] |
|
1
c715631f809a
First working commit. Works using <code type="whatvever">...</code>. Supports all languages supported by default in GeSHi
Dan
parents:
0
diff
changeset
|
76 |
); |
c715631f809a
First working commit. Works using <code type="whatvever">...</code>. Supports all languages supported by default in GeSHi
Dan
parents:
0
diff
changeset
|
77 |
$text = str_replace_once($match, "{GESHI_BLOCK:$i:$random_id}", $text); |
c715631f809a
First working commit. Works using <code type="whatvever">...</code>. Supports all languages supported by default in GeSHi
Dan
parents:
0
diff
changeset
|
78 |
} |
4 | 79 |
|
80 |
// Reinsert <nowiki> sections |
|
81 |
for ( $i = 0; $i < $nw; $i++ ) |
|
82 |
{ |
|
83 |
$text = str_replace('{NOWIKI:'.$random_id.':'.$i.'}', $nowiki[1][$i], $text); |
|
84 |
} |
|
1
c715631f809a
First working commit. Works using <code type="whatvever">...</code>. Supports all languages supported by default in GeSHi
Dan
parents:
0
diff
changeset
|
85 |
} |
c715631f809a
First working commit. Works using <code type="whatvever">...</code>. Supports all languages supported by default in GeSHi
Dan
parents:
0
diff
changeset
|
86 |
|
c715631f809a
First working commit. Works using <code type="whatvever">...</code>. Supports all languages supported by default in GeSHi
Dan
parents:
0
diff
changeset
|
87 |
function geshi_restore_code(&$text, &$codeblocks, $random_id) |
c715631f809a
First working commit. Works using <code type="whatvever">...</code>. Supports all languages supported by default in GeSHi
Dan
parents:
0
diff
changeset
|
88 |
{ |
c715631f809a
First working commit. Works using <code type="whatvever">...</code>. Supports all languages supported by default in GeSHi
Dan
parents:
0
diff
changeset
|
89 |
foreach ( $codeblocks as $i => $match ) |
c715631f809a
First working commit. Works using <code type="whatvever">...</code>. Supports all languages supported by default in GeSHi
Dan
parents:
0
diff
changeset
|
90 |
{ |
c715631f809a
First working commit. Works using <code type="whatvever">...</code>. Supports all languages supported by default in GeSHi
Dan
parents:
0
diff
changeset
|
91 |
$text = str_replace_once("{GESHI_BLOCK:$i:$random_id}", $match['match'], $text); |
c715631f809a
First working commit. Works using <code type="whatvever">...</code>. Supports all languages supported by default in GeSHi
Dan
parents:
0
diff
changeset
|
92 |
} |
c715631f809a
First working commit. Works using <code type="whatvever">...</code>. Supports all languages supported by default in GeSHi
Dan
parents:
0
diff
changeset
|
93 |
} |
c715631f809a
First working commit. Works using <code type="whatvever">...</code>. Supports all languages supported by default in GeSHi
Dan
parents:
0
diff
changeset
|
94 |
|
c715631f809a
First working commit. Works using <code type="whatvever">...</code>. Supports all languages supported by default in GeSHi
Dan
parents:
0
diff
changeset
|
95 |
// Formatter hook - where the actual highlighting is performed |
c715631f809a
First working commit. Works using <code type="whatvever">...</code>. Supports all languages supported by default in GeSHi
Dan
parents:
0
diff
changeset
|
96 |
$plugins->attachHook('render_wikiformat_veryearly', 'geshi_strip_code($text, $codeblocks, $random_id);'); |
c715631f809a
First working commit. Works using <code type="whatvever">...</code>. Supports all languages supported by default in GeSHi
Dan
parents:
0
diff
changeset
|
97 |
$plugins->attachHook('render_wikiformat_post', 'geshi_perform_highlight($result, $codeblocks, $random_id);'); |
c715631f809a
First working commit. Works using <code type="whatvever">...</code>. Supports all languages supported by default in GeSHi
Dan
parents:
0
diff
changeset
|
98 |
|
c715631f809a
First working commit. Works using <code type="whatvever">...</code>. Supports all languages supported by default in GeSHi
Dan
parents:
0
diff
changeset
|
99 |
function geshi_perform_highlight(&$text, &$codeblocks, $random_id) |
c715631f809a
First working commit. Works using <code type="whatvever">...</code>. Supports all languages supported by default in GeSHi
Dan
parents:
0
diff
changeset
|
100 |
{ |
c715631f809a
First working commit. Works using <code type="whatvever">...</code>. Supports all languages supported by default in GeSHi
Dan
parents:
0
diff
changeset
|
101 |
static $did_header_tweak = false; |
c715631f809a
First working commit. Works using <code type="whatvever">...</code>. Supports all languages supported by default in GeSHi
Dan
parents:
0
diff
changeset
|
102 |
if ( !$did_header_tweak ) |
c715631f809a
First working commit. Works using <code type="whatvever">...</code>. Supports all languages supported by default in GeSHi
Dan
parents:
0
diff
changeset
|
103 |
{ |
c715631f809a
First working commit. Works using <code type="whatvever">...</code>. Supports all languages supported by default in GeSHi
Dan
parents:
0
diff
changeset
|
104 |
$did_header_tweak = true; |
c715631f809a
First working commit. Works using <code type="whatvever">...</code>. Supports all languages supported by default in GeSHi
Dan
parents:
0
diff
changeset
|
105 |
global $template; |
c715631f809a
First working commit. Works using <code type="whatvever">...</code>. Supports all languages supported by default in GeSHi
Dan
parents:
0
diff
changeset
|
106 |
$template->add_header('<style type="text/css"> |
2 | 107 |
.geshi_highlighted a { |
1
c715631f809a
First working commit. Works using <code type="whatvever">...</code>. Supports all languages supported by default in GeSHi
Dan
parents:
0
diff
changeset
|
108 |
background-image: none !important; |
c715631f809a
First working commit. Works using <code type="whatvever">...</code>. Supports all languages supported by default in GeSHi
Dan
parents:
0
diff
changeset
|
109 |
padding-right: 0 !important; |
c715631f809a
First working commit. Works using <code type="whatvever">...</code>. Supports all languages supported by default in GeSHi
Dan
parents:
0
diff
changeset
|
110 |
} |
c715631f809a
First working commit. Works using <code type="whatvever">...</code>. Supports all languages supported by default in GeSHi
Dan
parents:
0
diff
changeset
|
111 |
</style> |
c715631f809a
First working commit. Works using <code type="whatvever">...</code>. Supports all languages supported by default in GeSHi
Dan
parents:
0
diff
changeset
|
112 |
'); |
c715631f809a
First working commit. Works using <code type="whatvever">...</code>. Supports all languages supported by default in GeSHi
Dan
parents:
0
diff
changeset
|
113 |
} |
c715631f809a
First working commit. Works using <code type="whatvever">...</code>. Supports all languages supported by default in GeSHi
Dan
parents:
0
diff
changeset
|
114 |
if ( !defined('GESHI_ROOT') ) |
c715631f809a
First working commit. Works using <code type="whatvever">...</code>. Supports all languages supported by default in GeSHi
Dan
parents:
0
diff
changeset
|
115 |
define('GESHI_ROOT', ENANO_ROOT . '/plugins/geshi/'); |
c715631f809a
First working commit. Works using <code type="whatvever">...</code>. Supports all languages supported by default in GeSHi
Dan
parents:
0
diff
changeset
|
116 |
|
c715631f809a
First working commit. Works using <code type="whatvever">...</code>. Supports all languages supported by default in GeSHi
Dan
parents:
0
diff
changeset
|
117 |
require_once ( GESHI_ROOT . '/base.php' ); |
c715631f809a
First working commit. Works using <code type="whatvever">...</code>. Supports all languages supported by default in GeSHi
Dan
parents:
0
diff
changeset
|
118 |
|
c715631f809a
First working commit. Works using <code type="whatvever">...</code>. Supports all languages supported by default in GeSHi
Dan
parents:
0
diff
changeset
|
119 |
foreach ( $codeblocks as $i => $match ) |
c715631f809a
First working commit. Works using <code type="whatvever">...</code>. Supports all languages supported by default in GeSHi
Dan
parents:
0
diff
changeset
|
120 |
{ |
c715631f809a
First working commit. Works using <code type="whatvever">...</code>. Supports all languages supported by default in GeSHi
Dan
parents:
0
diff
changeset
|
121 |
$lang =& $match['lang']; |
c715631f809a
First working commit. Works using <code type="whatvever">...</code>. Supports all languages supported by default in GeSHi
Dan
parents:
0
diff
changeset
|
122 |
$code =& $match['code']; |
c715631f809a
First working commit. Works using <code type="whatvever">...</code>. Supports all languages supported by default in GeSHi
Dan
parents:
0
diff
changeset
|
123 |
|
5
bfe00fc686f2
Improved trim behavior; removed that dumb side-scrolling hack (it borked up some stuff on enanocms.org)
Dan
parents:
4
diff
changeset
|
124 |
$geshi = new GeSHi(trim($code, "\r\n"), $lang, null); |
1
c715631f809a
First working commit. Works using <code type="whatvever">...</code>. Supports all languages supported by default in GeSHi
Dan
parents:
0
diff
changeset
|
125 |
$geshi->set_header_type(GESHI_HEADER_PRE); |
c715631f809a
First working commit. Works using <code type="whatvever">...</code>. Supports all languages supported by default in GeSHi
Dan
parents:
0
diff
changeset
|
126 |
// $geshi->enable_line_numbers(GESHI_FANCY_LINE_NUMBERS); |
c715631f809a
First working commit. Works using <code type="whatvever">...</code>. Supports all languages supported by default in GeSHi
Dan
parents:
0
diff
changeset
|
127 |
$geshi->set_overall_class('geshi_highlighted'); |
c715631f809a
First working commit. Works using <code type="whatvever">...</code>. Supports all languages supported by default in GeSHi
Dan
parents:
0
diff
changeset
|
128 |
$parsed = $geshi->parse_code(); |
c715631f809a
First working commit. Works using <code type="whatvever">...</code>. Supports all languages supported by default in GeSHi
Dan
parents:
0
diff
changeset
|
129 |
|
c715631f809a
First working commit. Works using <code type="whatvever">...</code>. Supports all languages supported by default in GeSHi
Dan
parents:
0
diff
changeset
|
130 |
$text = str_replace_once("{GESHI_BLOCK:$i:$random_id}", $parsed, $text); |
c715631f809a
First working commit. Works using <code type="whatvever">...</code>. Supports all languages supported by default in GeSHi
Dan
parents:
0
diff
changeset
|
131 |
} |
c715631f809a
First working commit. Works using <code type="whatvever">...</code>. Supports all languages supported by default in GeSHi
Dan
parents:
0
diff
changeset
|
132 |
} |