www.webdeveloper.com
Results 1 to 8 of 8

Thread: SyntaxHighlighter uncompressed shCore.js not working

  1. #1
    Join Date
    Feb 2011
    Posts
    4

    SyntaxHighlighter uncompressed shCore.js not working

    Hi,

    I am playing with SyntaxHighlighter v3.0.83 the uncompressed shCore.js and when I use it will not work. It just outputs plain text with no styles.

    I have edited the index.html that comes with the download from http://alexgorbatchev.com/SyntaxHighlighter/. Only thing I have edited is the path to scripts/shCore.js to src/shCore.php

    I have checked and all files are being loaded.

    Code:
        <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
        <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
        <head>
        	<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
        	<title>Hello SyntaxHighlighter</title>
        	<script type="text/javascript" src="src/shCore.js"></script>
        	<script type="text/javascript" src="scripts/shBrushJScript.js"></script>
        	<link type="text/css" rel="stylesheet" href="styles/shCoreDefault.css"/>
        	<script type="text/javascript">SyntaxHighlighter.all();</script>
        </head>
        
        <body style="background: white; font-family: Helvetica">
        
        <h1>Hello SyntaxHighlighter</h1>
        <pre class="brush: js;">
        function helloSyntaxHighlighter()
        {
        	return "hi!";
        }
        </pre>
        
        </html>
    Any ideas?

    Thanks

  2. #2
    Join Date
    Jul 2003
    Location
    The City of Roses
    Posts
    2,503
    You need to load a theme. For instance...

    <link rel="stylesheet" type="text/css" href="http://alexgorbatchev.com/pub/sh/current/styles/shThemeDefault.css">
    for(split(//,'))*))91:+9.*4:1A1+9,1))2*:..)))2*:31.-1)4131)1))2*:3)"'))
    {for(ord){$i+=$_&7;grep(vec($s,$i++,1)=1,1..($_>>3)-4);}}print"$s\n";

  3. #3
    Join Date
    Feb 2011
    Posts
    4
    Thanks for the reply Jeff Mott but that did not fix the problem.

    This is how the index.html that comes with the download looks now.

    Code:
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
    <head>
    	<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
    	<title>Hello SyntaxHighlighter</title>
    	<script type="text/javascript" src="src/shCore.js"></script>
    	<script type="text/javascript" src="scripts/shBrushJScript.js"></script>
    	<link type="text/css" rel="stylesheet" href="styles/shCoreDefault.css"/>
        <link type="text/css" rel="stylesheet" href="styles/shThemeDefault.css"/>
    
    	<script type="text/javascript">SyntaxHighlighter.all();</script>
    </head>
    
    <body style="background: white; font-family: Helvetica">
    
    <h1>Hello SyntaxHighlighter</h1>
    <pre class="brush: js;">
    function helloSyntaxHighlighter()
    {
    	return "hi!";
    }
    </pre>
    
    </html>

  4. #4
    Join Date
    Jul 2003
    Location
    The City of Roses
    Posts
    2,503
    I can't see your files, so I can't tell you exactly what's going wrong. All I can say is this works.

    Code:
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
        <title>Hello SyntaxHighlighter</title>
        <script type="text/javascript" src="http://alexgorbatchev.com/pub/sh/3.0.83/scripts/shCore.js"></script>
        <script type="text/javascript" src="http://alexgorbatchev.com/pub/sh/3.0.83/scripts/shBrushJScript.js"></script>
        <link type="text/css" rel="stylesheet" href="http://alexgorbatchev.com/pub/sh/3.0.83/styles/shCore.css"/>
        <link type="text/css" rel="stylesheet" href="http://alexgorbatchev.com/pub/sh/3.0.83/styles/shThemeDefault.css"/>
        <script type="text/javascript">SyntaxHighlighter.all();</script>
    </head>
    
    <body style="background: white; font-family: Helvetica">
    
    <h1>Hello SyntaxHighlighter</h1>
    <pre class="brush: js;">
    function helloSyntaxHighlighter()
    {
        return "hi!";
    }
    </pre>
    
    </html>
    for(split(//,'))*))91:+9.*4:1A1+9,1))2*:..)))2*:31.-1)4131)1))2*:3)"'))
    {for(ord){$i+=$_&7;grep(vec($s,$i++,1)=1,1..($_>>3)-4);}}print"$s\n";

  5. #5
    Join Date
    Feb 2011
    Posts
    4
    Thanks again for the reply.

    http://alexgorbatchev.com.s3.amazona...ipts/shCore.js is the packed version which looks to be encoded and cant edit it.

    Thats why I am using src/shCore.js which is not encoded but doesnt seem to work when you include it instead of the encoded one.

    I have put src/shCore.js onto pastebin http://pastebin.com/n6MJ5w0Z

  6. #6
    Join Date
    Jul 2003
    Location
    The City of Roses
    Posts
    2,503
    The sorta good news is that I was able to reproduce the error. But I don't have a solution yet. As far as I can tell, the unpacked version relies on a "require" function, but never defines it. I'm going to dig into this a bit more.
    for(split(//,'))*))91:+9.*4:1A1+9,1))2*:..)))2*:31.-1)4131)1))2*:3)"'))
    {for(ord){$i+=$_&7;grep(vec($s,$i++,1)=1,1..($_>>3)-4);}}print"$s\n";

  7. #7
    Join Date
    Feb 2011
    Posts
    4
    Thank you Jeff Mott

  8. #8
    Join Date
    Jul 2003
    Location
    The City of Roses
    Posts
    2,503
    The issue is that there's a script file, XRegExp.js, that's included in the packed version but missed when copying to the src folder.

    You can get a copy here... https://bitbucket.org/alexg/syntaxhi...pts/XRegExp.js
    for(split(//,'))*))91:+9.*4:1A1+9,1))2*:..)))2*:31.-1)4131)1))2*:3)"'))
    {for(ord){$i+=$_&7;grep(vec($s,$i++,1)=1,1..($_>>3)-4);}}print"$s\n";

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center



Recent Articles