Improved file preview html entity escaping