As Arden pointed out, the code directive uses the HTML pre entity. This is specifically designed so that the preformatted text remains formatted and doesn't wrap or break anywhere, leading to those stupid long boxes.
Yeah I find it annoying too, but it's there for a reason.