It seems that every code block is being created with a fixed height. Small blocks get extra padding at the bottom:  and large blocks get cut: 