1. Download
SyntaxHighlighter 3.0.83: http://alexgorbatchev.com/SyntaxHighlighter
2. Configuration
(1) The default tag parsed by SyntaxHighlighter, the default is pre
(2) Remove HTML line break tags
If your software adds < br /> tags at the end of each line, this option allows you to ignore those tags.
The implementation code in shCore.js is:
(3) Do not display the toolbar
3. Use
in the code3.1 brush is required, the rest are optional:
Brush value: java/xml/sql/c/js/css, etc. For details, see: http://alexgorbatchev.com/SyntaxHighlighter/manual/brushes/
3.2 Shading call:
or
The difference between all() and highlight() is that all() is registered in the onload() event.
4. Use in the blog garden
Blog Park supports SyntaxHighlighter by default. Code to modify the default value (because jQuery does not support setting the !important style, you need to set the cssText):
The above is the entire content of this article. Do you have a new understanding of how to use SyntaxHighlighter? I hope you will like this article.