3
\$\begingroup\$

I'm not sure this is the correct place to address this issue, but I have noticed something strange with the markdown after adding an image after posting the code in this entry.

After adding an image it updated the numbers between square brackets inside the code. This lead to code errors.

Would it be possible to exclude the code block from this update operation?

\$\endgroup\$
1
  • 1
    \$\begingroup\$ Updated Markdown to Markdown editor as correctly stated by Chris Jester-Young \$\endgroup\$
    – Willem
    Jul 14, 2014 at 17:50

1 Answer 1

5
\$\begingroup\$

So, there's two components to this: Markdown, and the Markdown editor. You're running into trouble with the latter.

In Markdown, links have two styles (and images are just the same, only with a ! before the [):

  • [link title](http://some.link/here)
  • [link title][linkref], where you can put in a [linkref]: http://some.link/here afterwards. (Note: linkref can be any identifier, it doesn't have to be numeric.)

The second style is useful where the same link is going to be used in multiple places in the document, and/or to keep the main text body uncluttered.

In the Stack Exchange Markdown editor, when you insert a link or image, it uses the second style, with numeric link references. This is because it doesn't know of a better name to use. It does not mean you have to stick with numeric link references. Just change the link references to non-numeric ones (and not colliding with other bracketed entities in your code), and it won't interfere with your code any more.

Personally, I almost always use the first style, then there aren't even any link references to worry about.

\$\endgroup\$
1
  • 2
    \$\begingroup\$ Thanks Chris, that is a way to avoid the problem with markdown editor. I will be using that from now on. \$\endgroup\$
    – Willem
    Jul 14, 2014 at 17:03

You must log in to answer this question.

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