staticnotes.org

TIL to create continuously numbered lists with content between items

⋅ 1 minute read

When writing notes in markdown I commonly encounter the problem that I want to create an automatically numbered list with content between the items. However, this messes up the numbering as it creates two separate numbered lists, e.g.

  1. My first point
  2. My second point

code block or image

  1. My third point
  2. My fourth point

The solution to this is embarassingly obvious once you know it. Just move the image or code block one level down by indenting it with four spaces. This keeps the list intact.

  1. My first point

  2. My second point

    code block or image

  3. My third point

  4. My fourth point

If you have any thoughts, questions, or feedback about this post, I would love to hear it. Please reach out to me via email.

#writing   #markdown