Hey y'all, long time no see. I have finally written the solution to this little problem, and now am in need of feedbacks and bug testing before submitting it as a PR.
To test it, just run the following code
http://pastebin.com/nuvehDT8For previewing all posts in the current thread, the behavior reminds exactly the same.
For external posts though, due to the limitation of the JSON API, the preview will not contain things like youtube embeds or board flags.