0

I do have a quick question about Markdown numbered list.

Basically, I am looking to write something like:

1) Idea 1
2) Idea 2

''' Some txt '''

3) Idea 3
4) Idea 4

''' Or some other text '''

3) Other Idea 3
4) Other Idea 4 

I found that 4 space before the two texts allows the numbers to continue, however, I can't find a way to restart the list to the point 3) a second time.

If anyone has already faced this issue I'd be glad to hear about the solution. I am working on PyCharm and it's a .md that is readable easily on GitHub.

2
  • "I can't find a way to restart the list to the point 3) a second time"—I'm confused why you'd want to. Can you provide a concrete example? In any case, not all Markdown implementations support this. Where are you trying to render this? Using which Markdown processor? Commented Feb 17, 2022 at 11:16
  • Well, for the context, I have datasets that contain some information. Let's say that I have a dataset A, A_extended1, and A_extended2. In my markdown, I wanted to write something like: The dataset A must contain info 1) 2) ... If you're working with the dataset A_extended1 you will need to use additional information. 3) 4). However, if you're working with A_extended2, you will need the additional information 3') 4') instead. And for the rendering, I don't really know what you're asking... I am working on PyCharm and it's a .md that is readable easily on GitHub... I can't say more sorry Commented Feb 17, 2022 at 12:21

1 Answer 1

1

I found that 4 space before the two texts allows the numbers to continue

Not exactly.

Four spaces before the two text lines makes that text part of the preceding list element:

1. Idea 1
2. Idea 2

    Idea 2, continued.

Since the list is still open, another list item continues numbering automatically.

However, if your text isn't really a continuation of Idea 2 it probably should not be indented.

In Markdown, lists are automatically renumbered. I usually write

1. Foo
1. Bar

so I don't have to worry about fixing numbers if I want to add something to the list. Markdown will render it as

  1. Foo
  2. Bar

However, GitHub Flavored Markdown, CommonMark, and others commonly do respect the first number in a list. Let's see what happens here:

5. Foo
1. Bar

This becomes

  1. Foo
  2. Bar

where the 5. is taken from my explicit numbering and the 6. continues from that point, even though I used 1. in the source.

I don't know if this will work in PyCharm, but for GitHub your example should work almost out of the box:

1. Idea 1
2. Idea 2

''' Some txt '''

3. Idea 3
4. Idea 4

''' Or some other text '''

3. Other Idea 3
4. Other Idea 4 

I just changed the 1) format to 1. The 2. and the two 4.s can be any number, but the 1., and the two 3.s indicate the number each list should start on.

Sign up to request clarification or add additional context in comments.

1 Comment

Hi, Sorry for the late replay I was on holiday. This doesn't work on Pycharm for some reason, but it is no big deal since it is working for GitHub, and that's what matters right now. Thanks for your help !

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.