add helper function to encode html