A syntax highlighter... Currently only for HTML and JavaScript
This function will take two parameters as input
- The text that you want to have syntax highlighting in an HTML page
- The language that the code is written in (currently only works for HTML and JavaScript)
The way this function works is by using a ton of String.replace(...) to wrap certain text bits into HTML span tags with classes. Those classes are then referenced in a CSS file and the styling is applied.
Below is an image of what it would look like (with additional styling to the <pre> and <div> before it:

The styling you see there is almost an exact replica of the VSCode Light+ theme (at least for the JavaScript highlighting), if you want the same styling code, see the sample-code-theme.css
If you don't want this styling, just make your own, just use the same classes and structure that I have there (not the one-line thing, but the way I am selecting the elements... it won't style correctly all the time if you don't do it like that).
For now, I am happy with what it is... someday I may start adding more and more languages that it will support, but in the near future I will probably add CSS and maybe Python...