update convertHtml function