开发者

SyntaxHighlighter v3.0.83 source code

I wanted to 开发者_StackOverflow中文版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>
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜