Rebuild HTML: post.rebake!(invalidate_oneboxes: true, invalidate_broken_images: true)
Rake posts:rebake
: post.rebake!(**opts)
where opts is generally empty
For the Oneboxes you can try task posts:refresh_oneboxes
and for the broken images you can try task posts:invalidate_broken_images
. The latter might be the solution to your problem.