I am just following the instruction over here and its not working any help?
<script type="text/javascript" src="sh/src/shCore.js"></script>
<script type="text/javascript" src="sh/scripts/shBrushJScript.js"></script>
<link href="sh/styles/shCore.css" rel="stylesheet" type="text/css" />
<!--<link href="sh/styles/shCoreDefault.css" rel="stylesheet" type="text/css" />-->
<link href="sh/styles/shThemeDefault.css" rel="stylesheet" type="text/css" />
<pre class="brush: js">
/**
* SyntaxHighlighter
*/
function foo()
{
if (counter <= 10)
return;
// it works!
}
</pre>
<script type="text/javascript">
SyntaxHighlighter.all()
</script>
Found some error in console don't know wt to do with it.
Uncaught ReferenceError: XRegExp is not defined shCore.js:123 Uncaught TypeError: Cannot read property 'Highlighter' of undefined shBrushJScript.js:45 Uncaught TypeError: Cannot read property 'all' of undefined test.php:21 Attr.specified is deprecated. Its value is always true.
After opening login.sh file in vim editor, press ESC key and type ':syntax on' to enable syntax highlighting. The file will look like the following image if syntax highlighting is on. Press ESC key and type, “syntax off” to disable syntax highlighting.
To configure syntax highlighting, click on “Language” in the top bar, then click the letter the language starts with, and then the language. If you want to define your own language, click on “Language” again, then click on “User Defined Language”, third from the bottom, and then click “Define your language”.
Go to the Prism project homepage (https://prismjs.com/), then to the download page as before, and generate a script file selecting only the coding languages you are interested in; don't reselect any plugins. Then download the JavaScript file. Remember: do not download the CSS file, only the prism. js file.
VS Code uses TextMate grammars as the syntax tokenization engine. Invented for the TextMate editor, they have been adopted by many other editors and IDEs due to large number of language bundles created and maintained by the Open Source community.
I found this LINK
Try to keep all your local files for syntax highliter in same directory like this:
<script type="text/javascript" src="sh/src/shCore.js"></script>
<script type="text/javascript" src="sh/src/shBrushJScript.js"></script>
OR
<script type="text/javascript" src="sh/scripts/shCore.js"></script>
<script type="text/javascript" src="sh/scripts/shBrushJScript.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