#2367 accepted
Neil Jenkins

HTML generation from markdown leads to mis-detected quote in Fastmail

Reported by Neil Jenkins | July 20th, 2019 @ 08:32 PM

When generating HTML from markdown where a user is top-posting, MailMate produces something like this:

<div>
    <p>This is the main body of the email, which should not be hidden as a quote.</p>
    <p>On 1 Jan 1970, at 0:00, no one wrote (the important thing about this line is that it end with a colon):</p>
</div>
<blockquote>
    <p>Some text, blaha blah bah.</p>
    <div>
        <p>Here is the second line.</p>
        <hr>
        <p>Some more text.</p>
        <p>And some more.</p>
    </div>
</blockquote>

The important thing here is the attribution line (On XXX, YYY wrote...) has been put inside a <div> with the message body. The Fastmail webmail detects this attribution line and presumes the whole containing <div> is part of the attribution (this is detecting a multi-line attribution style Outlook can generate) so hides it along with the <blockquote>, mistakenly hiding the actual message.

It would be much better if the attribution line were not in the same <div> as the rest of the text when top-posting, or even better were inside a <div> with the <blockquote> and an easily detectable class (which is what Gmail does), e.g.

<div>
    <p>This is the main body of the email, which should not be hidden as a quote.</p>
</div>
<div class="mailmate_quoted">
    <p>On 1 Jan 1970, at 0:00, no one wrote (the important thing about this line is that it end with a colon):</p>
    <blockquote>
        <p>Some text, blaha blah bah.</p>
        <div>
            <p>Here is the second line.</p>
            <hr>
            <p>Some more text.</p>
            <p>And some more.</p>
        </div>
    </blockquote>
</div>

(Note, I am a developer at Fastmail, and I freely admit that this could equally be considered a bug in our heuristics for detecting quoted sections of a message. However, I do think the HTML MailMate generates makes it tricky to isolate the quoted section and makes it difficult to differentiate from the structure produced by some Outlook versions where this is all part of the attribution line.)

Comments and changes to this ticket

  • benny

    benny August 1st, 2019 @ 08:39 AM

    • State changed from “new” to “accepted”

    Thanks for the feedback. I'm not sure I like the suggested solution since the attribution line is not part of the quoted content, but I also do not see any obvious alternatives :) Maybe I just need the attribution to be clearly marked as well:

    <div class="plaintext">  
        <p>This is the main body of the email, which should not be hidden as a quote.</p>
    </div>  
    <div class="quoted">  
        <div class="attribution">
            <p>On 1 Jan 1970, at 0:00, no one wrote (the important thing about this line is that it end with a colon):</p>
        </div>
        <blockquote>
            <p>Some text, blaha blah bah.</p>
        </blockquote>
    </div>
    

    As you probably know, these things can be very fragile and it's not unlikely that some other email client wouldn't expect this structure :)

    It's also not a straightforward change to make in MailMate (due to when the attribution line is generated), but I'll look into it and update this ticket if anything changes.

  • benny

    benny August 1st, 2019 @ 08:46 AM

    I realize that Outlook has a non-blockquote style of quoting. In that case, a structure like the above would also make more sense (if email clients ever agreed on doing anything the same way).

    (I also have an open request to support generating a multi-line attribution.)

  • Neil Jenkins

    Neil Jenkins August 1st, 2019 @ 02:09 PM

    I would have thought the simplest fix (and I would be surprised if it broke anything, as the structure is common), is to simply remove the <div> wrapping the content. This would be fine:

    <p>This is the main body of the email, which should not be hidden as a quote.</p>
    <p>On 1 Jan 1970, at 0:00, no one wrote (the important thing about this line is that it end with a colon):</p>
    <blockquote>
        <p>Some text, blaha blah bah.</p>
        <div>
            <p>Here is the second line.</p>
            <hr>
            <p>Some more text.</p>
            <p>And some more.</p>
        </div>
    </blockquote>
    

Please Sign in or create a free account to add a new ticket.

With your very own profile, you can contribute to projects, track your activity, watch tickets, receive and update tickets through your email and much more.

New-ticket Create new ticket

Create your profile

Help contribute to this project by taking a few moments to create your personal profile. Create your profile ยป

Mac OS X email client.

Shared Ticket Bins

People watching this ticket

Pages