Active
Project:
Syntax Highlighter
Version:
7.x-2.x-dev
Component:
Code
Priority:
Major
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
26 Jul 2011 at 21:58 UTC
Updated:
12 Apr 2019 at 16:45 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #1
mrfelton commentedComment #2
mrfelton commentedComment #3
mattyoung commentedThis stackoverflow post explains why you are getting the error:
http://stackoverflow.com/questions/4937915/syntaxhighlighter-v3-0-83-sou...
The reason is XRegExp *is* embedded in the minified "scripts/shCore.js" but is *not* in "src/shCore.js".
We don't use "src/shCore.js", we only use "scripts/shCore.js". The module expressly ignores the "src" directory. So I don't know how you end up with "src/shCore.js". This should not be possible.
If you really want to use "src/shCore.js" for debug purpose, I suggest:
append XRegExp to the end of "src/shCore.js"
mv src/shCore.js scripts/shCore.js
then restore scripts/shCore.js when you are done.
Comment #4
mrfelton commentedNo, not working as designed!
This was installed very simply from a drush make file
No funny business, no messing with the code. scripts/shCore.js is being loaded. XRegExp is not defined there.
Comment #5
mattyoung commentedThe problem is the code from bitbucket is the source, it's only for development/debugging and not for "regular" usage. It needs to be "built" for normal deployment usage, which minify the code and embed XRegExp. (see the build dir inside the source).
So you should not download from bitbucket, instead download from:
This give you the built version. This link is at http://alexgorbatchev.com/SyntaxHighlighter/download/
And FYI, the source is now at https://github.com/alexgorbatchev/SyntaxHighlighter
If you change the drush make, it should work without change.
Comment #6
mrfelton commentedGot it. Thanks for clearing that up.
Comment #7
mrfelton commentednah, sorry but it doesn't work. Latest syntaxhighlighter downloaded from http://alexgorbatchev.com/SyntaxHighlighter/download/download.php?sh_cur.... Still does not work without my patch.
Comment #8
jdvc commentedAlex recently moved the syntax highlighter project to github, and I ran into the same exact issue after cloning from there as described in the stackoverflow discussion linked to in #3.
So don't clone it, just make sure to download the project from http://alexgorbatchev.com/SyntaxHighlighter/download/, other than that thanks for the awesome module!
Comment #9
mattyoung commentedComment #10
morbiD commentedThe download links in previous comments seemingly went dead at some point within the last 6 months and are producing 404 errors; the download link on the SyntaxHighlighter website now goes straight to the master branch on github instead.
You can still grab the pre-built version from snapshots on archive.org (last one was Nov 2016) but if that ever goes dead then the only way to make this module work will be to build the library from source, which apparently requires node.js.
Perhaps a better solution is now desirable?
Comment #11
ao2 commentedThe pre-built versions are available also on github: https://github.com/syntaxhighlighter/SyntaxHighlighter-Site/tree/master/...
So I guess the fix for D7 is to use this URL in the drush make file.
BTW the issue has been fixed in the D8 port I am working on.
Comment #12
ao2 commentedComment #13
numerabilis commentedAleluia! I found out what´s missing!!!
Mr. Felton, your patch didn´t run in Drupal 7.64 and Syntx Highlighter 7.x-2.0 so I decided to insert manually these lines in the file syntaxhighlighter.module:
I noticed in the page source that XRegExp.js was there but not together all other scripts.
So I realized I should do a little change to work out:
Now it works!!! After soooooo many hours driving me crazy... so happy now!!! lol
This section became this: