589 B
589 B
This is a azure nodejs function that parses and runs prism on the server. PrismJS is a Syntax highlighting tool. This web api used by my blog which does not run Node and cannot use prism. I wanted syntax highlighting but didn't want to take the performance hit for loading JS and parsing the code client side. This replaces markdown fenced code with the HTML equivilent parsed for prism. My blog only loads the Prism css which is only an extra 1k. I avoided using the JS so I can serve AMP pages, and also keep my 100 lighthouse score.