5

I encountered some strange behaviour when posting this answer

The problem: The inclusion of images altered code in the code block. Specifically, my code contained double indices of the form

[i][1]
[i][2]
[i][1]
[i][2]

Which after uploading a few images, gets changed to (approximately)

[i][3]
[i][2]
[i][4]
[i][2]

And duplicate links to some of the images were added at the bottom of the post. It seems that the double indices are being interpreted as referring to the uploaded images. The problem can be reproduced by:

  1. Adding indices as in the first block above.
  2. Before, or after, marking the indices as a code block, include 2 or more images above it.

At least in preview, the problem can be resolved by including the images first, and then adding the code. It's hard to tell whether this is something that can be easily fixed, but it caught me off guard. Is this intended behaviour?

  • 1
    This is a consequence of how images are marked up in markup - ![][]. This confuses the parser when it gets to code like the above - not an easy fix. – Oded Feb 12 '13 at 17:00
  • @Oded thanks for the reply, I figured as much. Once one is aware of the issue, the workaround is easy enough anyway :) – Scott H. Feb 12 '13 at 17:12
  • It's not the first time it has been reported (particularly prevalent in coding), but I don't know if and when this will be fixed. – Oded Feb 12 '13 at 17:13
  • See also my question on Meta.SO (which was already closed as a duplicate ...) – Hendrik Vogt Feb 13 '13 at 16:27
  • @HendrikVogt Thanks for pointing that one out. – Scott H. Feb 13 '13 at 19:48

You must log in to answer this question.

Browse other questions tagged .