summaryrefslogtreecommitdiffstats
path: root/paste/include/pastify.inc
diff options
context:
space:
mode:
Diffstat (limited to 'paste/include/pastify.inc')
-rw-r--r--paste/include/pastify.inc17
1 files changed, 5 insertions, 12 deletions
diff --git a/paste/include/pastify.inc b/paste/include/pastify.inc
index 321fe51..bb3d2f9 100644
--- a/paste/include/pastify.inc
+++ b/paste/include/pastify.inc
@@ -4,6 +4,7 @@ This software is licensed through a BSD-style License.
http://www.opensource.org/licenses/bsd-license.php
Copyright (c) 2002 - 2009 Jacob D. Cohen
+Copyright (c) 2009 Alexander Sulfrian
All rights reserved.
Redistribution and use in source and binary forms, with or without
@@ -32,7 +33,7 @@ THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-require_once("highlight.inc");
+require_once("class.geshi.php");
function PastifyText($text, $language, $desc)
{
@@ -47,11 +48,8 @@ function PastifyText($text, $language, $desc)
$lineout = "";
# Do the actual syntax highlighting
- $output = SyntaxHighlight($text, $language);
-
- for ($i = 1; $i < $nlines; ++$i)
- $lineout .= "$i\n";
- $lineout .= "$i";
+ $geshi = new GeSHi($text, $language);
+ $output = $geshi->parse_code();
$html = <<<EOH
<html>
@@ -74,12 +72,7 @@ function PastifyText($text, $language, $desc)
</table>
</div>
-<table border="0" cellpadding="1" cellspacing="2">
-<tr>
- <td><pre class="code">$lineout</pre></td>
- <td width="100%"><pre class="code" id="codemain">$output</pre></td>
-</tr>
-</table>
+$output
</html>
EOH;