Add Google Code Prettify to Blogger with Scrollbar Fix

Initially, I used CSS-defined blockquote to implement a sort of code display.

A couple of days ago, I came across a blog that recommended Google's code-prettify project https://www.shushen.xyz/

That made me think about how to bring this into Blogger.


For the original usage, refer to the readme

1. Include the JS

2. Use it in code blocks

and that's it


Approach

Load a JS script that converts

into

Reference: GPT

Final result

https://github.com/crazypeace/blogger-replace-blockquote-to-pre/blob/main/blockquote2pre.js

Referencing past experience, using GitHub Pages to solve MIME type mismatch 

This way to obtain the JS file 

https://crazypeace.github.io/blogger-replace-blockquote-to-pre/blockquote2pre.js


Deployment

Modify the Blogger template

Add references to two JS files.