Prevent unnecessary html from rendering.

From #2964.