# Discourse inserting Unwanted \<br\>

**URL:** https://meta.discourse.org/t/discourse-inserting-unwanted-br/113064
**Category:** Support
**Created:** [March 31, 2019, 5:41pm UTC](https://meta.discourse.org/t/discourse-inserting-unwanted-br/113064 "2019-03-31T17:41:39Z")
**Posts on this page:** 13
**Page:** 1

<div class="post-metadata">

### Author: ![Mark\_W\_Bennett](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/mark_w_bennett/32/130717_2.png) [@Mark\_W\_Bennett](https://meta.discourse.org/u/Mark_W_Bennett)
#### Post date: [March 31, 2019, 5:41pm UTC](https://meta.discourse.org/t/discourse-inserting-unwanted-br/113064/1 "2019-03-31T17:41:39Z")

</div>

When a user sends a message to our community via email, using Outlook, unwanted line feeds are being inserted.  
For example, the user sends:

```
<p class=3D"MsoNormal"><span style=3D"font-size:16.0pt;font-family:&quot;Ti=
mes New Roman&quot;,serif;color:#002060">The Fair Defense Act requires atto=
rneys seeking appointments for juvenile delinquency cases to have averaged =
twelve (12) hours a year of continuing legal education
 courses or other training relating specifically to juvenile law.&nbsp; Thi=
s seminar will satisfy the required annual 12 hours of CLE if you do not al=
ready have them.<o:p></o:p></span></p>

```

and Discourse inserts a `<br>` between `education` and ` courses.`

Or the user sends:

```
<p class=3D"MsoNormal"><span style=3D"font-size:16.0pt;font-family:&quot;Ti=
mes New Roman&quot;,serif;color:#002060">If you
<i>are</i> a member of TCDLA, you can register here:&nbsp; </span><b><span =
style=3D"font-size:14.0pt;font-family:&quot;Times New Roman&quot;,serif;col=
or:red"><a href=3D"[URL]><span style=3D"color:red">Click here
 to register on TCDLA</span></a></span></b><span style=3D"font-size:16.0pt;=
font-family:&quot;Times New Roman&quot;,serif;color:#002060"><o:p></o:p></s=
pan></p>

```

and Discourse inserts a `<br>` between `you` and `<i>are</i>`

When I send the same message from Fastmail, I don’t get the same result. So I’m willing to blame this on Outlook, but before I do, is this a Discourse bug?

---

<div class="post-metadata">

### Author: ![Richie](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/richie/32/115110_2.png) [@Richie](https://meta.discourse.org/u/Richie)
#### Post date: [March 31, 2019, 8:05pm UTC](https://meta.discourse.org/t/discourse-inserting-unwanted-br/113064/2 "2019-03-31T20:05:56Z")

</div>

Your examples show the text as being on separate lines, I’d expect it to insert a `<br />` there?

---

<div class="post-metadata">

### Author: ![Mark\_W\_Bennett](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/mark_w_bennett/32/130717_2.png) [@Mark\_W\_Bennett](https://meta.discourse.org/u/Mark_W_Bennett)
#### Post date: [March 31, 2019, 9:06pm UTC](https://meta.discourse.org/t/discourse-inserting-unwanted-br/113064/3 "2019-03-31T21:06:31Z")

</div>

Yes, it appears that Outlook is putting in a line break that an HTML browser doesn’t interpret as a line break (so that if you send or receive the email there is no line break there) but Discourse does.

---

<div class="post-metadata">

### Author: ![Mittineague](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/mittineague/32/114259_2.png) [@Mittineague](https://meta.discourse.org/u/Mittineague)
#### Post date: [March 31, 2019, 9:36pm UTC](https://meta.discourse.org/t/discourse-inserting-unwanted-br/113064/4 "2019-03-31T21:36:52Z")

</div>

> [@Mark\_W\_Bennett](#):
>
> unwanted line feeds are being inserted.

It looks like more than that alone is happening. I assume the "3D"s are hex for the equal sign, which would be redundant and AFAIK likely cause breakage. And the single quotation marks around the font family are entities instead of single quotes. Then there is an empty namespaced p element which I’m guessing is for the default spacing instead of using CSS to create spacing. etc.

Maybe the Outlook email client knows how to deal with that mess, but I don’t think it should be expected that anything else would be able to.

---

<div class="post-metadata">

### Author: ![sam](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/sam/32/102149_2.png) [@sam](https://meta.discourse.org/u/sam)
#### Post date: [April 1, 2019, 1:38am UTC](https://meta.discourse.org/t/discourse-inserting-unwanted-br/113064/5 "2019-04-01T01:38:44Z")

</div>

Would you know the exact version of outlook (and platform) that is mangling our emails? When we send mail out we are super careful to have valid HTML.

---

<div class="post-metadata">

### Author: ![Stephen](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/stephen/32/95011_2.png) [@Stephen](https://meta.discourse.org/u/Stephen)
#### Post date: [April 1, 2019, 1:43am UTC](https://meta.discourse.org/t/discourse-inserting-unwanted-br/113064/6 "2019-04-01T01:43:46Z")

</div>

I read it as relating to inbound email, Discourse interpreting the CRLF which Outlook adds to HTML emails as `</ br>`

HTML ignores line breaks and interprets all text between tags as contiguous. It appears that there’s some kind of plaintext-to-html happening before the HTML is rendered out.

---

<div class="post-metadata">

### Author: ![sam](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/sam/32/102149_2.png) [@sam](https://meta.discourse.org/u/sam)
#### Post date: [April 1, 2019, 1:48am UTC](https://meta.discourse.org/t/discourse-inserting-unwanted-br/113064/7 "2019-04-01T01:48:46Z")

</div>

@zogstrip any ideas here?

---

<div class="post-metadata">

### Author: ![Stephen](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/stephen/32/95011_2.png) [@Stephen](https://meta.discourse.org/u/Stephen)
#### Post date: [April 1, 2019, 1:56am UTC](https://meta.discourse.org/t/discourse-inserting-unwanted-br/113064/8 "2019-04-01T01:56:06Z")

</div>

@Mark_W_Bennett can you ask your user to check the following setting:

```
File > Options > Advanced
International Options > Preferred Encoding for Outgoing Messages

```

Is it set to `Unicode (UTF-8)`?

If not can you ask them to change it to UTF-8 and re-test? Outlook may need to be restarted after they change that setting.

---

<div class="post-metadata">

### Author: ![zogstrip](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/zogstrip/32/512781_2.png) [@zogstrip](https://meta.discourse.org/u/zogstrip)
#### Post date: [April 2, 2019, 7:37am UTC](https://meta.discourse.org/t/discourse-inserting-unwanted-br/113064/9 "2019-04-02T07:37:20Z")

</div>

@Mark_W_Bennett Have you tried enabling the “`traditional markdown linebreaks`” site setting? That might help.

@Stephen How is encoding related to the issue discussed here?

---

<div class="post-metadata">

### Author: ![Mark\_W\_Bennett](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/mark_w_bennett/32/130717_2.png) [@Mark\_W\_Bennett](https://meta.discourse.org/u/Mark_W_Bennett)
#### Post date: [April 2, 2019, 1:26pm UTC](https://meta.discourse.org/t/discourse-inserting-unwanted-br/113064/10 "2019-04-02T13:26:35Z")

</div>

The user reports that it is set to UTF-8.

---

<div class="post-metadata">

### Author: ![Mark\_W\_Bennett](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/mark_w_bennett/32/130717_2.png) [@Mark\_W\_Bennett](https://meta.discourse.org/u/Mark_W_Bennett)
#### Post date: [April 2, 2019, 1:27pm UTC](https://meta.discourse.org/t/discourse-inserting-unwanted-br/113064/11 "2019-04-02T13:27:10Z")

</div>

@zogstrip I have not, but I will.

---

<div class="post-metadata">

### Author: ![Stephen](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/stephen/32/95011_2.png) [@Stephen](https://meta.discourse.org/u/Stephen)
#### Post date: [April 2, 2019, 1:40pm UTC](https://meta.discourse.org/t/discourse-inserting-unwanted-br/113064/12 "2019-04-02T13:40:59Z")

</div>

It’s a long-standing problem with Outlook (best part of a decade) where if the client isn’t set to UTF-8 it will add additional line breaks to a message. Plagued us back in the days of Lotus, which ignored both the 77 column wrap and misinterpreted those breaks within mesasges.

---

<div class="post-metadata">

### Author: ![JammyDodger](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/jammydodger/32/254611_2.png) [@JammyDodger](https://meta.discourse.org/u/JammyDodger)
#### Post date: [June 8, 2022, 7:24pm UTC](https://meta.discourse.org/t/discourse-inserting-unwanted-br/113064/14 "2022-06-08T19:24:47Z")

</div>


