The pre tag preserves both spaces and line breaks:
Humpty Dumpty sat on a wall, Humpty Dumpty had a great fall. All the King’s horses and all the King’s men, Couldn’t put Humpty together again.
Description: