I don't see the need for this ``markup`` variable. Couldn't you simply use ``out.write`` instead of using ``markup.push``? Or perhaps I am missing something.
``out.write`` is doing the same thing: pushing its arguments to an array on which the join method is called at the end of markup generation.