The link button in the post editor incorrectly escapes square brackets in inline code.

To reproduce:

  • Write the following MarkDown in the editor

    text text `function[]` text text
  • Select `function[]`, press the link button (link button), and enter some link

  • the result will be [`function\[\]`][1] which renders as function\[\]

This comes up very often in Mathematica-related posts when I'm linking to the documentation because the usual way to indicate that a symbol is a function in Mathematica is adding [] after it.

This is a minor thing, as it's easy to manually remove the backslashes, but it's somewhat annoying so I thought I'd mention it.

Edit by Mr.Wizard
It is September 2013 and this still hasn't been fixed. While "adding [] after it" is not presently the custom on Mathematica.SE this is still a bug and still needs to be fixed.

  • I avoid this by not including the [] :) However, the few times that I have included, it has not been a problem for me because I never use the link button. If you enter your links by hand (like I do) as: [`foo[]`](url), then it works perfectly fine... Commented Feb 14, 2012 at 15:55
  • 4
    @yoda I wasn't really asking for a workaround (there are many), just wanted to make sure the problem was registered. I don't like [...](...) style links (too long and distracting when editing), so I use CTRL-L, which is the same as the link button.
    – Szabolcs
    Commented Feb 14, 2012 at 16:03
  • The way I discovered to deal with this annoyance is to change the text to use [ and ] for left and right square brackets respectively. The editor could do that for us after we submit the link. --- It's unfortunate that @Szabolcs bug has flown under the radar for a half dozen years while all the related bugs have status-completed - See: Comment bug with URLs and square brackets and Would it be possible to fix links containing parentheses in comments? - Perhaps an edit-bump is due.
    – Rob
    Commented Aug 31, 2018 at 3:46


You must log in to answer this question.

Browse other questions tagged .