Change record status: 
Project: 
Introduced in branch: 
11.x
Introduced in version: 
11.0.2
Description: 

The textarea HTML element returns value with "\r\n" line breaks.

Drupal now normalizes newline character by replacing "\r\n" or "\r" line breaks with "\n". This setting is enabled by default for all textarea form elements via the new property #normalize_newlines, which has a default value of TRUE.

In order to disable normalization set this property to FALSE:

$form['mail_text'] = [
  '#type' => 'textarea',
  '#normalize_newlines' => FALSE,
];
Impacts: 
Module developers