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
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...
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>
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>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With