# メールのコードブロックのインデントを無効化

**URL:** <https://meta.discourse.org/t/disable-indent-code-block-for-emails/93707>\
**Category:** Feature\
**Created:** [2018 年 8 月 2 日午前 2:30 UTC](https://meta.discourse.org/t/disable-indent-code-block-for-emails/93707 "2018-08-02T02:30:23Z")\
**Posts on this page:** 1\
**Showing post:** 17

<div class="post-metadata">

**Author:** ![dan](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/dan/32/101549_2.png) [@dan](https://meta.discourse.org/u/dan)\
**Post date:** [2019 年 4 月 12 日午後 10:39 UTC](https://meta.discourse.org/t/disable-indent-code-block-for-emails/93707/17 "2019-04-12T22:39:57Z")

</div>

I just [submitted a pull request](https://github.com/discourse/discourse/pull/7375) to introduce a new site setting `strip incoming email lines `. I did not want to completely disable code blocks when this setting is enabled, so code blocks will still be accepted between [code]…[/code] and ```…```, but all the other lines will be stripped (leading and trailing whitespaces will be removed).

For example, the following email:

```plaintext
MIME-Version: 1.0
Date: Tue, 01 Jan 2019 00:00:00 +0300
Subject: An email with whitespaces
From: Foo <foo@discourse.org>
To: bar@discourse.org
Content-Type: text/plain; charset="UTF-8"

Hello

    This is a line that will be stripped
    This is another line that will be stripped

This is a line that will not be touched.
This is another line that will not be touched.

[code]
  1.upto(10).each do |i|
    puts i
  end
[/code]

    This is going to be stripped too.

Bye!

```

will produce the following reply:

* * *

Hello

This is a line that will be stripped  
This is another line that will be stripped

This is a line that will not be touched.  
This is another line that will not be touched.

```plaintext
  1.upto(10).each do |i|
    puts i
  end
```

This is going to be stripped too.

Bye!

* * *

disabling this setting will create the following reply:

* * *

Hello

```
This is a line that will be stripped
This is another line that will be stripped

```

This is a line that will not be touched.  
This is another line that will not be touched.

```plaintext
  1.upto(10).each do |i|
    puts i
  end
```

```
This is going to be stripped too.

```

Bye!

* * *

---

_[View the full topic](https://meta.discourse.org/t/disable-indent-code-block-for-emails/93707)._
