# Email replies truncated at code fences with tildes

**URL:** https://discourse.cmake.org/t/email-replies-truncated-at-code-fences-with-tildes/743
**Category:** Site Feedback
**Created:** [March 1, 2020, 9:24pm UTC](https://discourse.cmake.org/t/email-replies-truncated-at-code-fences-with-tildes/743 "2020-03-01T21:24:15Z")
**Posts on this page:** 15
**Page:** 1

<div class="post-metadata">

### Author: ![airwin](https://discourse.cmake.org/letter_avatar_proxy/v4/letter/a/f4b2a3/32.png) [@airwin](https://discourse.cmake.org/u/airwin)
#### Post date: [March 1, 2020, 9:24pm UTC](https://discourse.cmake.org/t/email-replies-truncated-at-code-fences-with-tildes/743/1 "2020-03-01T21:24:15Z")

</div>

I just now used email to reply to some CMake discourse code traffic, and used the  
above common markdown command (that certainly works when hand-posting to CMake discourse) to surround text that was to be taken literally. However, your email filter programme incorrectly truncated everything in the post from the first instance of the above command to the end. I was able to work around the issue by hand-editing my post, but that should not be necessary so please fix this CMake discourse bug by making sure your email filter programme is aware of all valid markdown syntax that is available when you hand-edit posts.

---

<div class="post-metadata">

### Author: ![brad.king](https://discourse.cmake.org/user_avatar/discourse.cmake.org/brad.king/32/11_2.png) [@brad.king](https://discourse.cmake.org/u/brad.king)
#### Post date: [March 2, 2020, 2:08pm UTC](https://discourse.cmake.org/t/email-replies-truncated-at-code-fences-with-tildes/743/2 "2020-03-02T14:08:06Z")

</div>

Discourse is a general-purpose platform that we happen to deploy for CMake but do not develop or maintain ourselves. You can ask about this on upstream [https://meta.discourse.org/](https://meta.discourse.org/) instead.

---

<div class="post-metadata">

### Author: ![airwin](https://discourse.cmake.org/letter_avatar_proxy/v4/letter/a/f4b2a3/32.png) [@airwin](https://discourse.cmake.org/u/airwin)
#### Post date: [March 2, 2020, 6:57pm UTC](https://discourse.cmake.org/t/email-replies-truncated-at-code-fences-with-tildes/743/3 "2020-03-02T18:57:28Z")

</div>

@brad.king said:

> Discourse is a general-purpose platform that we happen to deploy for  
> CMake but do not develop or maintain ourselves. You can ask about  
> this on upstream [https://meta.discourse.org/](https://meta.discourse.org/) instead.

So far in a few days use I have found one bug (the present case) and  
one misfeature (email always addressed personally) for discourse.  
So it is likely I will find additional issues in the near future.

However, there are two reasons why I believe that Kitware staff should  
be the ones reporting the subset of these bug/misfeature complaints  
that you judge to be valid to the discourse developers.

1. You were the ones that decided that discourse was better than the  
traditional mailing-list approach that has served the CMake  
community so well in the past. I am sure you had your valid  
reasons for switching, but this choice _is_ still your  
responsibility and not your users’ responsibility.

2. You (now as a major user of discourse) have enormously more clout  
than than individual users when reporting such issues.

---

<div class="post-metadata">

### Author: ![brad.king](https://discourse.cmake.org/user_avatar/discourse.cmake.org/brad.king/32/11_2.png) [@brad.king](https://discourse.cmake.org/u/brad.king)
#### Post date: [March 2, 2020, 7:34pm UTC](https://discourse.cmake.org/t/email-replies-truncated-at-code-fences-with-tildes/743/4 "2020-03-02T19:34:54Z")

</div>

We chose to switch from mailman to discourse because web forums are what modern communities expect. It does come with some trade-offs for old-school mailing list users no infrastructure will please everyone. Discourse upstream will not consider the use of personal email addresses to be a bug or misfeature. Discourse is not a mailing list. It is a web forum with email notification features. Email notifications always go to personal email.

As for the reply-by-email truncation, let’s try to reproduce it here. Please try replying here by email with a message of the form that got truncated for you before. Let it get truncated. Then create a new separate post via the web forum in your browser using the exact same text cut-n-pasted from your email client composition. That way we’ll have a concrete example.

---

<div class="post-metadata">

### Author: ![ben.boeckel](https://discourse.cmake.org/letter_avatar_proxy/v4/letter/b/ea5d25/32.png) [@ben.boeckel](https://discourse.cmake.org/u/ben.boeckel)
#### Post date: [March 2, 2020, 8:00pm UTC](https://discourse.cmake.org/t/email-replies-truncated-at-code-fences-with-tildes/743/5 "2020-03-02T20:00:21Z")

</div>

My gut feeling is that it’s detecting it as a signature separator. I do see this: [https://github.com/discourse/discourse/blob/master/script/import\_scripts/sourceforge.rb#L120](https://github.com/discourse/discourse/blob/master/script/import_scripts/sourceforge.rb#L120) which seems to indicate that it was not supported at all at one point. I don’t see anything obvious in the code about it though.

---

<div class="post-metadata">

### Author: ![airwin](https://discourse.cmake.org/letter_avatar_proxy/v4/letter/a/f4b2a3/32.png) [@airwin](https://discourse.cmake.org/u/airwin)
#### Post date: [March 3, 2020, 5:17am UTC](https://discourse.cmake.org/t/email-replies-truncated-at-code-fences-with-tildes/743/6 "2020-03-03T05:17:20Z")

</div>

As requested here is my attempt to trigger this bug again:

---

<div class="post-metadata">

### Author: ![airwin](https://discourse.cmake.org/letter_avatar_proxy/v4/letter/a/f4b2a3/32.png) [@airwin](https://discourse.cmake.org/u/airwin)
#### Post date: [March 3, 2020, 5:18am UTC](https://discourse.cmake.org/t/email-replies-truncated-at-code-fences-with-tildes/743/7 "2020-03-03T05:18:49Z")

</div>

As requested here is my attempt to trigger this bug again:

```auto
# a bunch of text to leave unmolested.

```

more text.

---

<div class="post-metadata">

### Author: ![airwin](https://discourse.cmake.org/letter_avatar_proxy/v4/letter/a/f4b2a3/32.png) [@airwin](https://discourse.cmake.org/u/airwin)
#### Post date: [March 3, 2020, 5:20am UTC](https://discourse.cmake.org/t/email-replies-truncated-at-code-fences-with-tildes/743/8 "2020-03-03T05:20:01Z")

</div>

As you can see, I was able to trigger the bug again. The first truncated message was a result of sending mail containing the second message.

---

<div class="post-metadata">

### Author: ![brad.king](https://discourse.cmake.org/user_avatar/discourse.cmake.org/brad.king/32/11_2.png) [@brad.king](https://discourse.cmake.org/u/brad.king)
#### Post date: [March 3, 2020, 12:08pm UTC](https://discourse.cmake.org/t/email-replies-truncated-at-code-fences-with-tildes/743/9 "2020-03-03T12:08:31Z")

</div>

> As you can see, I was able to trigger the bug again. The first truncated message was a result  
> of sending mail containing the second message.

Thanks. That’s a good reference. I’m sending this reply by email to try  
a different quoting syntax.

```auto
Quoted block of text.

```

Unquoted paragraph after quoted block.

---

<div class="post-metadata">

### Author: ![brad.king](https://discourse.cmake.org/user_avatar/discourse.cmake.org/brad.king/32/11_2.png) [@brad.king](https://discourse.cmake.org/u/brad.king)
#### Post date: [March 3, 2020, 12:19pm UTC](https://discourse.cmake.org/t/email-replies-truncated-at-code-fences-with-tildes/743/10 "2020-03-03T12:19:57Z")

</div>

For reference, my previous post was sent by email with this source text:

````auto
...different quoting syntax.

```
Quoted block of text.
```

Unquoted paragraph after quoted block.

````

Quoting with back-ticks instead of tildes works, so you can use that as a workaround.

---

<div class="post-metadata">

### Author: ![brad.king](https://discourse.cmake.org/user_avatar/discourse.cmake.org/brad.king/32/11_2.png) [@brad.king](https://discourse.cmake.org/u/brad.king)
#### Post date: [March 3, 2020, 12:20pm UTC](https://discourse.cmake.org/t/email-replies-truncated-at-code-fences-with-tildes/743/11 "2020-03-03T12:20:20Z")

</div>

I think discourse uses [discourse/email\_reply\_trimmer](https://github.com/discourse/email_reply_trimmer) to parse emails. The [code here](https://github.com/discourse/email_reply_trimmer/blob/c3e2988fb663857f72bfb85dacff035fbf4e2778/lib/email_reply_trimmer/delimiter_matcher.rb) looks like it will consider a line of `~` characters to be a delimiter, and that is [used here](https://github.com/discourse/email_reply_trimmer/blob/c3e2988fb663857f72bfb85dacff035fbf4e2778/lib/email_reply_trimmer.rb#L42) to remove everything following it.

---

<div class="post-metadata">

### Author: ![brad.king](https://discourse.cmake.org/user_avatar/discourse.cmake.org/brad.king/32/11_2.png) [@brad.king](https://discourse.cmake.org/u/brad.king)
#### Post date: [March 3, 2020, 12:22pm UTC](https://discourse.cmake.org/t/email-replies-truncated-at-code-fences-with-tildes/743/12 "2020-03-03T12:22:38Z")

</div>

Another reply by email to try another quoting syntax:

```nohighlight
Quoted block of text.
```

---

<div class="post-metadata">

### Author: ![brad.king](https://discourse.cmake.org/user_avatar/discourse.cmake.org/brad.king/32/11_2.png) [@brad.king](https://discourse.cmake.org/u/brad.king)
#### Post date: [March 3, 2020, 12:25pm UTC](https://discourse.cmake.org/t/email-replies-truncated-at-code-fences-with-tildes/743/13 "2020-03-03T12:25:31Z")

</div>

My second post by email had the following source:

```auto
another quoting syntax:

~~~text
Quoted block of text.
~~~

Unquoted paragraph after quoted block.

```

The content type text on the start-block line prevented it from being treated as a delimiter, but the end-block line `~~~` was treated as a delimiter and chopped the rest of the message.

---

<div class="post-metadata">

### Author: ![brad.king](https://discourse.cmake.org/user_avatar/discourse.cmake.org/brad.king/32/11_2.png) [@brad.king](https://discourse.cmake.org/u/brad.king)
#### Post date: [March 3, 2020, 12:32pm UTC](https://discourse.cmake.org/t/email-replies-truncated-at-code-fences-with-tildes/743/14 "2020-03-03T12:32:28Z")

</div>

A similar problem was discussed on `meta.discourse.org` here:

> **[Fenced code blocks don't work with ~~~…~~~](https://meta.discourse.org/t/fenced-code-blocks-dont-work-with/28219)**
>
> Both triple \` and ~ should be supported as the start and end of fenced code blocks but only backticks seem to work here. This is a fenced code block This is a fenced code block

but I think that was about rendering in the forum in general, which now works as the end of the thread claims.

---

<div class="post-metadata">

### Author: ![brad.king](https://discourse.cmake.org/user_avatar/discourse.cmake.org/brad.king/32/11_2.png) [@brad.king](https://discourse.cmake.org/u/brad.king)
#### Post date: [March 3, 2020, 12:47pm UTC](https://discourse.cmake.org/t/email-replies-truncated-at-code-fences-with-tildes/743/15 "2020-03-03T12:47:16Z")

</div>

I’ve posted a report on `meta.discourse.org`:

> **[Email replies truncated at code fences with tildes](https://meta.discourse.org/t/email-replies-truncated-at-code-fences-with-tildes/143198/)**
>
> Code fences with ~~~have been supported in the forum since at least 2017: However, when replying by email the reply trimmer truncates messages on~~~ lines, likely mistaking them for delimiters. For example, sending the literal source text ...
