Encode html then save into db