A code block written by hand is pretty simple: use the 'pre' and 'code' HTML elements and the browser gives you a monospace font and keeps your line breaks, but it stops there. So every keyword, string, comment and variable comes out in the exact same color, which is fine for a few lines of YAML...
Source: [Dev.to](https://dev.to/lucastonelli/improving-html-code-blocks-readability-with-a-syntax-highlighter-3o0b)