blogger source code highlight

1.Edited the HTML source of the blog theme and inserted these lines toward the end of the <head> section:




<link crossorigin="anonymous" href="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/11.3.1/styles/default.min.css" integrity="sha512-3xLMEigMNYLDJLAgaGlDSxpGykyb+nQnJBzbkQy2a0gyVKL2ZpNOPIj1rD8IPFaJbwAgId/atho1+LBpWu5DhA==" referrerpolicy="no-referrer" rel="stylesheet" />
<script crossorigin="anonymous" integrity="sha512-Pbb8o120v5/hN/a6LjF4N4Lxou+xYZ0QcVF8J6TWhBbHmctQWd8O6xTDmHpE/91OjPzCk4JRoiJsexHYg4SotQ==" referrerpolicy="no-referrer" src="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/11.3.1/highlight.min.js"></script>
<script language="javascript" type="text/javascript"> hljs.highlightAll();</script>
2.Wrapping code blocks within 
<pre><code> ... </code></pre> 
in the HTML view of the composer

3.Example
public class Hello{

        public static void main(String[] args){
        System.out.println("Hello World!");

     }
}

https://highlightjs.org/
Post a Comment (0)
Previous Post Next Post