1

My blog is hosted in blogger and i want to add code snippet to my blogs. I followed this SO Post on how to add SyntaxHighlighter However i am not sure if that answer is still valid.

Questions
1>In html view, I don't see <head> element. Should i manually add <head> tag in html view? I thought html view is only for body element.

2>The SyntaxHighlighter scripts are hosted on CDN here. Which scripts i need to add for C#, html and javascript?

3> What is shAutoloader.js? does it load all the scripts?

I have created a sample blog here using Syntaxhighlighter but its not working

Community
  • 1
  • 1
LP13
  • 30,567
  • 53
  • 217
  • 400
  • I checked the sample blog, the Syntax highlighter is not working because it has been loaded twice on the page (once via an HTML/JavaScript gadget named codehiglighter and another time via the post content.) Removing the repeat code from inside the post and then calling the Syntax highlighter (via `` which should be placed near the `

    ` tag in the theme code (present in Theme > Edit HTML) would likely solve this issue)

    – Prayag Verma Mar 25 '17 at 08:02

1 Answers1

0

Question no 1's Answer:

If you don't see any tag you need to add it in your template but normally every HTML as well as blogger template has a tag closed by

Second Question's Answer:

You need to use following attribute to load external files, you can use multiple but keep them in of template for better performance:

<script src="..../Link OF Code.js"></script>

You can use defer="defer" tag in case if you want to load a script after the whole page is loaded successfully, here is a sample:

<script defer="defer" src="..../Link OF Code.js"></script>

Third Question's Answer:

I don't know it.

Fahim Raza
  • 271
  • 3
  • 16