admin管理员组

文章数量:1296473

I wanted to play with SyntaxHighlighter so I downloaded the lastest version from /. 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 e with the download.

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

Thanks

I wanted to play with SyntaxHighlighter so I downloaded the lastest version from http://alexgorbatchev./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 e with the download.

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

Thanks

Share Improve this question asked Feb 8, 2011 at 20:17 JohnJohn 515 bronze badges
Add a ment  | 

3 Answers 3

Reset to default 9

Yes. SyntaxHighlighter version 3.0.83 requires Steven Levithan's XRegExp.js library ver 1.5.0. The pressed version of SH which works (scripts/shCore.js 16,175 bytes), has XRegexp.js built-in. However, the unpressed 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 unpressed XRegExp.js file and will allow you to play around with it and pile/press 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-press\syntax-highlighter-press.php

and add the following line to wp_shc_head() :

    <!-- START: Syntax Highlighter ComPress -->
  <script type="text/javascript" src="http://xregexp./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./xregexp.js"></script>
<script type="text/javascript" src="http://xregexp./addons/backpat.js"></script>

本文标签: javascriptSyntaxHighlighter v3083 source codeStack Overflow