Meta Stack Exchange is where users like you discuss bugs, features, and support issues that affect the software powering all 158 Stack Exchange communities.

What is meta?
Here's how it works:
  1. Any Stack Exchange user can ask a question
  2. The community provides support, votes on ideas, and reports bugs
  3. Your voice helps shape the way Stack Exchange operates

This is a very minor bug, but I still think it is important to point it out (maybe it was already).

I voted another question to be closed as duplicate of PHP preg_replace \

Since the title ends with a backslash, the text generated is:

enter image description here

which results in

enter image description here

Though, linking to the question in this question (by just inserting the link) obviously creates an appropriate link. Maybe this automatic link detection / title creation should be done for comments as well, to avoid this issue (which I admit is a minor case)?

(Unfortunately it does not look like escaping the backslash (\\) helps in any way).

Other problematic characters:

share|improve this question
Alright, that's it, NO MORE MARKDOWN. Straw, camel, etc., you ruined it for more network, sorry folks. Also, in light of these bug reports we're renaming it to MarkdownDull, since we're closing up shop can won't be fixing said bugs, etc. – Nick Craver Apr 2 '12 at 10:47
Ok... I will go home then :-/ Sorry for ruining everyones day... – Felix Apr 2 '12 at 10:47
Test: possible duplicate of php preg_replace \ – Manishearth Apr 2 '12 at 10:50
\\ test \\ test [test \]( – Manishearth Apr 2 '12 at 10:53
[this ends with an escaped backslash (\\) \](…). – Felix Apr 2 '12 at 11:03
@Nick I don’t get it. It’s not Markdown that’s at fault here, it’s the fact that the comments don’t use (full-blown) Markdown. After all, it works the normal text. – Konrad Rudolph Apr 2 '12 at 11:11
@Konrad - Nor should they, the issue is that the title is not properly escaped for markdown mini, will take a look after the gym. – Nick Craver Apr 2 '12 at 11:40
[Link with trailing space ](…). – Felix May 7 '12 at 9:07

I "fixed" this a long time ago. Scare quotes because I cheated; here's the relevant snippet from the code:

public static class MarkdownMaker
    /// <summary>
    /// Returns a [markdown](http://link) that, when run through markdown, creates HTML
    /// where linkText is displayed exactly as given. In other words, an asterisk in linkText
    /// is visible as an asterisk to the user (and cannot cause unwanted italicization),
    /// a closing bracket in linkText doesn't break the link, but is actually visible as
    /// a closing bracket, etc. If markdownMini is true, it's for putting it in comments,
    /// otherwise it's for posts.
    /// </summary>
    public static string Link(string linkText, string url, bool markdownMini)
        // ...
        if (markdownMini)
        // ...

            // there is absolutely no way to end a comment link with a backslash
            // -- it would always escape the closing "]". So we're using an ugly
            // unicode hack -- U+2216 is Set Minus, which looks closest to a regular
            // backslash
            if (linkText.EndsWith(@"\"))
                linkText = linkText.Substring(0, linkText.Length - 1) + "\u2216";

        // ...

share|improve this answer

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .