block by curran 8f65dc5fbdd07fb0271a2a66479e4be9


Full Screen

I was searching for a way to indent a generated HTML fragment string, and was frustrated that all the packages I could find for doing this seem overly complex for the task at hand:

So I thought to myself, how hard could it be to write a function that indents HTML? It should be about a page of code, and would be a fun little puzzle. This is the result from the experiment, a small function that indents an HTML or XML fragment string.

If you find this useful and would like it released as a proper package, please let me know.

Built with

web counter