Content display fixes (for WCH)

@aronasorman this is a repeat of #2613 - which had been targeted to develop, but develop has not been merged back into WCH since. (the decision to cascade in the other direction was taken shortly after this was merged).

As develop now has @cpauya's new test suite merged in, it seems more sensible just to merge this stuff directly.