Don't like the signature. I think your formatter should take care of the number of HTML elements to be added, so as to make it look like a normal document. It's not the user's job to decide how many `<i>` and `<h1>` a typical HTML text should have. To me, the only argument that the formatter should take is the maximum (final) string size .