See fiddle: if you press Enter in the textarea on a recent Mac, the newline character appears to be represented by \r, which would be in direct contrast to the answers to this, this and this question and to Wikipedia. To summarise these links:
\rrepresents a line break on old Macs (OS 9 and before)\nrepresents a line break on UNIX systems (OS X, Linux)\r\nrepresents a line break on Windows.
When I press Enter in the JSFiddle, I get the following result (OS X 10.11.6):
textarea: \r
span: \n
This behaviour took a long time to figure out and seems illogical. What could be the underlying rationale?