Minimal test case:
The div is not tidied or sanitized. There needs to be no new pages in the Recent Changes table for this to occur. Observed on iu.wikipedia (test URI may be unbroken if a new page is in the RC table). The extra closing tag and the transclusion of Newpages were quite far apart as well.