Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

SyntaxHighlighter v3.0.83 source code

I wanted to play with SyntaxHighlighter so I downloaded the lastest version from http://alexgorbatchev.com/SyntaxHighlighter/. The src/shCore.js file which is a unpacked/unencoded version does not seem to work when I change from scripts/shCore.js to src/shCore.js in the index.html that come with the download.

Does anyone know why or know where I can get a working source code so I can have a play.

Thanks

like image 222
John Avatar asked Feb 08 '11 20:02

John


3 Answers

Yes. SyntaxHighlighter version 3.0.83 requires Steven Levithan's XRegExp.js library ver 1.5.0. The compressed version of SH which works (scripts/shCore.js 16,175 bytes), has XRegexp.js built-in. However, the uncompressed version, (src/shCore.js 43,502 bytes) will not work until you place a copy of XRegExp.js into the same folder (It is not included in the src folder in the download file.)

Note that if you download the full source archive, this includes the uncompressed XRegExp.js file and will allow you to play around with it and compile/compress it if you want.

Note also, that there is a pretty wicked bug in SyntaxHighlighter which causes it to get confused and incorrectly colorize code. I have written an article describing the bug, and how to fix it. See: Fixing the SyntaxHighlighter 3.0.83 Parser Bug. I notified the author about the bug but an official fix has not yet been implemented.

This answer is a bit late, but I still hope it may helps someone...

like image 135
ridgerunner Avatar answered Oct 06 '22 01:10

ridgerunner


excellent adding!

for debugging, go to wp-content\plugins\syntax-highlighter-compress\syntax-highlighter-compress.php

and add the following line to wp_shc_head() :

    <!-- START: Syntax Highlighter ComPress -->
  <script type="text/javascript" src="http://xregexp.com/xregexp.js"></script>
like image 39
Pavel 'PK' Kaminsky Avatar answered Oct 05 '22 23:10

Pavel 'PK' Kaminsky


These days, v.2.0.0 broke the Syntax Highlighter code, so be sure to include both:

<script type="text/javascript" src="http://xregexp.com/xregexp.js"></script>
<script type="text/javascript" src="http://xregexp.com/addons/backcompat.js"></script>
like image 30
Dennis S. Avatar answered Oct 05 '22 23:10

Dennis S.