I had a try at fixing this issue here:
https://github.com/discourse/discourse/pull/8326
This is a best-effort fix which tries to replace constructs such as post:{old post number}, topic:{old topic ID} using data from quoted_posts and moved_posts, without knowing if it is indeed a part of the [quote] tag.