# Syntax highlight and MathJax is not rendered after reloading an edited post

I don't know how long this has been happening, but I recently noticed what seems to be a regression: after clicking the "An edit has been made to this post" banner that appears when a question or an answer has been edited while you're viewing it, any code syntax highlighting or math formatting in the post fails to render.

Steps to reproduce:

1. Open a question with highlighted code or MathJax markup that is likely to get edited soon. (The newest questions page on SO or math.SE is a good place to find some.)
2. Leave the question open until someone edits it and the "An edit has been made to this post" banner appears. (For efficiency, open several questions in separate tabs and wait a few minutes until one of them gets edited.)
3. Click the banner. Observe that the question gets reloaded, but it loses any syntax highlighting or math formatting.

(The bug also occurs for edited answers, but those tend to be harder to find on demand. Unfortunately, editing a post yourself while having it open in another tab doesn't seem to work, since the banner never appears in that case.)

FWIW, the cause of this bug appears to be a missing call to styleCode() (or equivalent code) in the reloadPosts function in realtime-se.js, as included in the full.en.js bundle. (In particular, running styleCode() from the browser JavaScript console after reloading the post restores the missing syntax highlighting.) I'm pretty sure this used to work automatically, so I suspect this is a regression caused by some recent code reorganization.

• BTW, re-running styleCode() does have the side effect of breaking the click handling on spoilers (because the pre-existing click handlers are not removed). I consider that a separate bug, as it seems clear that the function is intended to be re-runnable. – Ilmari Karonen Jul 31 at 20:37
• I noticed this today, and yes, this surprised me, I'm sure it worked before. – Gilles Aug 10 at 8:06
• Just noticed this today. Still an issue – Pureferret Sep 12 at 11:17