fix incorrect count of line breaks between client and server side

Hello,

stumbled upon a bug where the line breaks are miscounted in client side.

with this bug the client side validation passes and server side validation fails

Please review