First time here? Check out the FAQ!
1

How to insert images into a numbered list with markdown?

If there is an image between numbered list items, then you get wrong numbers. Example:

  1. Number One

image description

  1. Number Two (but you see 1.)

image description

  1. Number Three (but you see 1.)

image description

Toms's avatar
767
Toms
asked 2012-11-16 05:06:50 -0600
Evgeny's avatar
13.2k
Evgeny
updated 2012-11-17 10:26:04 -0600
edit flag offensive 0 remove flag close merge delete

Comments

Removed tag "bug" as the described behavior is by design of the markdown library.

Evgeny's avatar Evgeny (2012-11-16 17:11:56 -0600) edit
add a comment see more comments

1 Answer

1

This is actually correct behavior.

  1. First item.

Unindented content breaks up the list.

  1. Second item.

To make this work, you need to indent your images to make them part of the list:

  1. First item.

    Indented content appears as part of the previous list item.

  2. Second item.

todofixthis's avatar
1.3k
todofixthis
answered 2012-11-16 09:19:48 -0600, updated 2012-11-17 09:56:53 -0600
edit flag offensive 0 remove flag delete link

Comments

but if you want to make the counts your self, you can not! I can not write in the text: 4. This ist forth something, scince I get 1. This ist forth something . For me this is not correct

Toms's avatar Toms (2012-11-16 10:10:03 -0600) edit
1

This is how markdown works. You can try using the wysiwig editor (tinymce). Neither one we can change significantly as they both depend on third-party libraries.

Evgeny's avatar Evgeny (2012-11-16 12:38:57 -0600) edit

@todofixthis Could you make an example with images? thank you

Toms's avatar Toms (2012-11-17 05:41:29 -0600) edit

Updated answer with lolcats (:

todofixthis's avatar todofixthis (2012-11-17 09:57:18 -0600) edit

@todofixthis Thank you! I see it works, but it is too complicated for new users and it shifts the pictures to the right and makes them smaller, which is not so good for images with text.

Toms's avatar Toms (2012-11-17 13:08:28 -0600) edit
add a comment see more comments