تقليم يحذف تنسيق ماركداون

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)

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)

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)

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)

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…