Open inoas opened 7 years ago
Moving from:
case 'PLAINTEXT':
$entity->translated_body = '<pre class="plaintext">'
. nl2br(htmlentities(
$entity->translated_body, ENT_XML1 | ENT_NOQUOTES | ENT_SUBSTITUTE), true)
. '</pre>';
break;
To:
case 'PLAINTEXT':
$entity->translated_body = htmlentities(
$entity->translated_body, ENT_XML1 | ENT_NOQUOTES | ENT_SUBSTITUTE);
$entity->translated_body = str_replace(' ', ' ', $entity->translated_body);
$entity->translated_body = str_replace("\t", '	', $entity->translated_body);
$entity->translated_body = nl2br($entity->translated_body, true);
$entity->translated_body = '<pre class="plaintext">' . $entity->translated_body . '</pre>';
break;
Resolved most of the issue but there is still the left padding injected by indent()
that shifts the <pre>
output to the right.
I am building some Twig based Content Application Framework and when debugging
<pre>
's newlines and whitespaces should be left untouched to support plain-text content type.