Saturday, May 9, 2015

How to add and use syntaxhighlighter on blogger (blogspot)

Warning: This post are outdated. Please check my new entry HERE

Peace be upon you, Now you can use syntaxhighlighter in your blog by simply add the code below to the <head/> element in the template for your Blogger blog. For your record, I'm using syntaxhighlighter version 3.0.83, This version removed clipboard.swf because it is vulnerable to arbitrary XSS attack on Wordpress. But as blogger, nothing to worried about it.
<!-- BEGIN SyntaxHighlighter BEGIN -->
	<link href='http://api.kriptonium.com/syntaxhighlighter_3.0.83/styles/shCoreDefault.css' rel='stylesheet' type='text/css'/>
	<link href='http://api.kriptonium.com/syntaxhighlighter_3.0.83/styles/shThemeDefault.css' rel='stylesheet' type='text/css'/>
	<script src='http://api.kriptonium.com/syntaxhighlighter_3.0.83/scripts/shCore.js' type='text/javascript'/>
	<script src='http://api.kriptonium.com/syntaxhighlighter_3.0.83/scripts/shBrushBash.js' type='text/javascript'/>
	<script src='http://api.kriptonium.com/syntaxhighlighter_3.0.83/scripts/shBrushCpp.js' type='text/javascript'/>
	<script src='http://api.kriptonium.com/syntaxhighlighter_3.0.83/scripts/shBrushCSharp.js' type='text/javascript'/>
	<script src='http://api.kriptonium.com/syntaxhighlighter_3.0.83/scripts/shBrushCss.js' type='text/javascript'/>
	<script src='http://api.kriptonium.com/syntaxhighlighter_3.0.83/scripts/shBrushDiff.js' type='text/javascript'/>
	<script src='http://api.kriptonium.com/syntaxhighlighter_3.0.83/scripts/shBrushJava.js' type='text/javascript'/>
	<script src='http://api.kriptonium.com/syntaxhighlighter_3.0.83/scripts/shBrushJScript.js' type='text/javascript'/>
	<script src='http://api.kriptonium.com/syntaxhighlighter_3.0.83/scripts/shBrushPerl.js' type='text/javascript'/>
	<script src='http://api.kriptonium.com/syntaxhighlighter_3.0.83/scripts/shBrushPhp.js' type='text/javascript'/>
	<script src='http://api.kriptonium.com/syntaxhighlighter_3.0.83/scripts/shBrushPlain.js' type='text/javascript'/>
	<script src='http://api.kriptonium.com/syntaxhighlighter_3.0.83/scripts/shBrushPython.js' type='text/javascript'/>
	<script src='http://api.kriptonium.com/syntaxhighlighter_3.0.83/scripts/shBrushRuby.js' type='text/javascript'/>
	<script src='http://api.kriptonium.com/syntaxhighlighter_3.0.83/scripts/shBrushSql.js' type='text/javascript'/>
	<script src='http://api.kriptonium.com/syntaxhighlighter_3.0.83/scripts/shBrushVb.js' type='text/javascript'/>
	<script src='http://api.kriptonium.com/syntaxhighlighter_3.0.83/scripts/shBrushXml.js' type='text/javascript'/>
	<script language='javascript' type='text/javascript'>
    SyntaxHighlighter.config.bloggerMode = true;
    SyntaxHighlighter.all();
 </script>


If you found my host are down or this script are outdated, please inform me. I will update it as soon as possible ;)

No comments:

Post a Comment