Convert buffer text and decorations to HTML