23

This question was recently closed as a duplicate of (![]+[])[+[]]… Explain why this works. However, the inserted link blows up as the weird title does not get escaped properly in the resulting markdown.

bad

Of course, a point could be made that the title of the question should be changed, but it would still probably be a good idea to get the escaping right, as these characters are allowed in a title and do not carry any special meaning there, only when copied verbatim into markdown code.

3
  • Related: ctrl + i to italicize does not always work right. Markdown doesn't seem to be escaped when necessary.
    – Jeremy
    Aug 27 '11 at 0:30
  • @JeremyBanks - How is that related? Sep 27 '11 at 15:07
  • @KevinVermeer: They're both caused by Markdown being automatically transformed naively as though it were plain text.
    – Jeremy
    Sep 27 '11 at 15:45
9
+400

This will be fixed in the next build. We'll be escaping [ and ] as we already do for question titles inserted into the "possible duplicate..." comments.

5
  • Are those the only characters that can cause problems?
    – user154510
    Sep 27 '11 at 15:10
  • @Matthew - in this particular case, since it's the [title](link) format that blows up here. We use that shorthand because the "Possible duplicate:" section needs to be completely self-contained. Sep 27 '11 at 15:11
  • 1
    OK, thanks for the info! Congrats on 20k :P
    – user154510
    Sep 27 '11 at 15:15
  • Shouldn't all markup be escaped? For example, in this edit a question with a python argument named __code__ in the title is linked, and that is of course interpreted as markdown. Since titles are plain text, any markdown markup should be ignored. Jul 2 '12 at 11:22
  • Or better still, implement the other answer to this question and not insert the title at all. Jul 2 '12 at 11:26
13

There's an easy fix for this. Instead of inserting this:

> **Possible Duplicate:**  
> [(![]+[])[+[]]… Explain why this works](https://stackoverflow.com/questions/4170978/explain-why-this-works)  

<!-- End of automatically inserted text -->

Just insert this:

> **Possible Duplicate:**  
> https://stackoverflow.com/questions/4170978/explain-why-this-works

<!-- End of automatically inserted text -->

The link gets displayed as the question title anyways (without needing to explicitly specify the title) like so:

Possible Duplicate:
(![]+[])[+[]]... Explain why this works

3
  • 4
    Using the direct link would also be possible to know when the duplicated question has been deleted; in that case, the link will not converted in a title.
    – apaderno
    Sep 20 '11 at 16:59
  • 1
    Plus, this would make it easier to be consistent when editing in multiple duplicates. Sep 27 '11 at 15:05
  • 2
    +1 for this. A question was closed as duplicate whilst the thing it's a duplicate of was very temporarily called "About to be deleted". This title was made semi-permanent in the dup banner until I went and modified it manually. Just insert http://stackoverflow.com/questions/4170978: keep the title out of it altogether. Oct 10 '11 at 18:46

You must log in to answer this question.

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