Lighthouse has a new layout. Prefer the old one? Return to the old layout, and switch back any time from the link at the top of each page.

Markdown support doesn't support escaped characters

#387

When using the Markdown support, I should be able to use _ and * to escape these Markdown characters (to get an actual '_' or '*'). This doesn't appear to work (at least in the previewer, I don't see it working properly).

Using build 3371.

thanks,

Reported by Steve Mayer · May 1st, 2013 @ 06:24 PM

State: new
Milestone: none
Assigned to: benny benny

Activity

  1. benny
    benny
    • State changed from new to reproduced

    It actually works, but it's not obvious because MailMate is a bit too smart in this case. MailMate keeps an eye on whether any Markdown syntax is actually used or not. This is done by running it through conversion and then look for non-trivial markup. If none is used then the message is sent as plain text without the use of Markdown.

    In other words, this won't work as expected with Markdown enabled:

    This is not \*emphasized\*.
    

    But this works:

    This is not \*emphasized\*, but this is *emphasized*.
    

    The latter works because Markdown is enabled.

    The solution/workaround is to disabled Markdown if Markdown is not really used and then not escape the symbols.

    Did that make sense? :-)

    I like that MailMate automatically detects when Markdown is not needed, so I'm unsure how this can be improved. Maybe I should also do a simple check for escaped characters. I'll think about that.

    May 1st, 2013 @ 06:52 PM

  2. Steve Mayer
    Steve Mayer

    Let me see if I can clarify.

    I had a paragraph that I wanted emphasized, so I added _ to the beginning and end of the paragraph. In the preview window, all was italicized (as expected). Within that paragraph, there was a phrase that contained underscores that I wanted to keep as underscores (and not try to emphasize any surrounding characters), i.e. This_is_what (not Thisiswhat)

    In this case, I should have been able to use Markdown, but type 'This_is_what' and have the underscores left in place. I didn't see this happening in the preview window.

    Hope that clarifies things.

    May 1st, 2013 @ 06:59 PM

  3. benny
    benny

    Ah, got it now. Apparently there is a bug in the Markdown converter (I use a slightly altered version of sundown). I'll look into it, but it may take a while if it's non-trivial (not a high priority item).

    Apparently a few Markdown implementation have problems with this special case as can be seen here.

    May 1st, 2013 @ 07:09 PM

  4. Steve Mayer
    Steve Mayer

    Thanks Benny!

    Appreciate the link also. Shows that what I want to have happen only breaks in RedCarpet 2.2.2.

    May 1st, 2013 @ 07:15 PM

  5. benny
    benny

    And 'marked 0.2.6'. RedCarpet is also based on sundown, so it makes sense that it fails in MailMate as well.

    May 1st, 2013 @ 07:18 PM

  6. benny
    benny
    • State changed from reproduced to fixcommitted

    All my changes to sundown can be seen here.

    May 3rd, 2013 @ 11:01 AM

  7. Steve Mayer
    Steve Mayer

    Benny,

    I noticed that the latest test build fixes this issue. I am seeing some strange side effect though. Email addresses appear a little strangely as shown in the screenshot I've attached.

    Any thoughts?

    May 4th, 2013 @ 02:34 PM

  8. benny
    benny

    Thanks, I don't think it is related to my fix, but I did update my version of sundown with the latest changes on github (after doing the fix) and either that included a bug or merging with some of my changes created a bug.

    Let me know if you see other issues. I can reproduce this and I'll look into it.

    May 4th, 2013 @ 02:39 PM

  9. Steve Mayer
    Steve Mayer

    Will do. Thanks for the quick response!

    May 4th, 2013 @ 02:41 PM

  10. benny
    benny

    It seems the problem is somehow related to how I compiled the sundown executable (I cannot reproduce the problem on my current machine). Unfortunately I cannot release a new version before Monday.

    May 4th, 2013 @ 03:28 PM

  11. benny
    benny

    A new test version is available now (r3384).

    May 6th, 2013 @ 09:26 AM

  12. Steve Mayer
    Steve Mayer

    Thanks for the fix Benny!

    May 6th, 2013 @ 02:46 PM

  13. benny
    benny
    • State changed from fixcommitted to fixreleased

    July 5th, 2013 @ 11:25 AM

  14. Steve Mayer
    Steve Mayer

    Benny,

    I posted this in the maillist, but I'm re-opening this ticket as the behavior has returned.

    If I try to escape the underscore characters (This_is_a_test), I'll end up with the backslashes in the output. If I don't put the backslashes in, I'll get Thisisatest (with italics present).

    Using the latest b3816.

    Thanks!

    November 4th, 2013 @ 11:16 PM

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.