not sure why I added this line.. one thing we should probably do is to always limit line breaks **before** the white spaces since line breaks change the white space rules (we never add trailing white spaces)

maybe it should only remove the WhiteSpaces if `expected` is bigger than `0`.