# בלוקי קוד במיילים מכילים שורות חדשות ריקות

**URL:** <https://meta.discourse.org/t/code-blocks-in-emails-have-empty-newlines/195271>\
**Category:** Product Support\
**Created:** [28 ביוני,‏ 2021,‏ 7:34pm UTC](https://meta.discourse.org/t/code-blocks-in-emails-have-empty-newlines/195271 "2021-06-28T19:34:39Z")\
**Posts on this page:** 1\
**Showing post:** 5

<div class="post-metadata">

**Author:** ![scztt](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/scztt/32/105683_2.png) [@scztt](https://meta.discourse.org/u/scztt)\
**Post date:** [21 ביוני,‏ 2022,‏ 12:47pm UTC](https://meta.discourse.org/t/code-blocks-in-emails-have-empty-newlines/195271/5 "2022-06-21T12:47:17Z")

</div>

I still see the problem with emails sent from 2.9.0.beta1 - please ignore the rest of this if it’s been fixed since then 🙂

This is not related to a specific email client - the second screenshot I posted is of the raw HTML being generated for emails. But actually, it’s more enlightening to look at the actual email content (a snippet…):

```plaintext
<pre style=3D"word-wrap: break-word; max-width: 694px;"><code style=3D"di=
splay: block; background-color: #f9f9f9; overflow: auto; padding: 5px;; b=
ackground-color: #f9f9f9; padding: 2px 5px;">=0D
(=0D
// This expects two keys to be defined: ~history (the list) and ~recordKe=
y (which key to record)=0D
Pdef(\keyRecorder, Pbind(=0D
	\callback, Pfunc({=0D
		|event|=0D
		event[\callback].addFunc({ // combine your record func with any previou=
s callback that was there (it's okay if its nil)=0D
			~history.add(currentEnvironment[~recordKey])=0D
		}).postln;=0D
	})=0D
));=0D
=0D

```

It’s clear that there are (a) ACTUAL newlines where there would be newlines in the code, and (b) `=0D` characters (carriage returns) at the end of every line. AFAIK all newlines inside of a `<pre>` are supposed to be interpreted literally, which explains the double new-lines.

I can reproduce the issue in Gmail, and by opening the HTML part of the email message directly in a browser (after replacing the quoted printable characters like `=0D`). This makes me curious:

- Do you see the same (newlines plus `=0D`’s) when you look at the raw version of the email you posted?
- If you do, what does the HTML source look like for the “correct” view you posted? Is your email client somehow stripping the `=0D`’s (or the newlines, for that matter)?

In any case, even if it’s a specific issue with Gmail, it’s probably worth at least looking into this since Gmail is by far the most common email client.

---

_[View the full topic](https://meta.discourse.org/t/code-blocks-in-emails-have-empty-newlines/195271)._
