Trimming elides markdown format

We encounter an issue when email contain hyphens underlining a line, which markdown recognises as a heading. This is trimmed away by the trim algo. We have to always show the trimmed content since many people use our instance by email only.

Steps to reproduce:

Basically in the Advanced Email test enter:

This is text before

Header
------

This is text after

Which in markdown would be rendered as:

This is text before

Header

This is text after

The result is that the text before the header is removed and after is elided!

Is there a way to adjust the trimming to not elide lines of hyphens that follows a line with the same number of characters? At least markdown seems to be able to deal with that.

ā€“
Iā€™m on
2.9.0.beta4
(14f61c5784)

1 Like

Have you tried disabling the setting trim incoming emails ?

Yes of course disabling the trimming does not elide the next :slight_smile:
However, the problem then comes when people reply to a very very long email thread via email and then all that thread is shown the web view. That is not nice. Hence I would like to re-enable the trimming!

So you want the trim feature enable but the ----- signature removal feature? Thatā€™s tricky. Can users be told to use ATX headings instead of Setext headings?

2 Likes

As the lead developer of the application that creates the emails @artur talks about: Yes, we could change it (or use ^^^^ instead of ---- in the ā€œunderlineā€), but this is technically not markdown but simply a text/plain email thatā€™s formatted in a ā€œniceā€ way for humans. And the ā€œunderlinedā€ headings do look a bit nicer IMHO than using markdown-style # something headings

Anyway, donā€™t email signatures that are delimited with -- usually have a blank line right before the -- line? So maybe that could be taken into account when parsing emails?

2 Likes

I think thats handled here

If you want to propose a PR we can take a look at it. Itā€™s a tricky area, as regressions are very visible.

2 Likes

I just tested that using a mix of characters i.e. -=-=-=-= does not does get trimmed away.

Seems one should just use characters which are not in the delimiter listā€¦