In the following markdown code I want item 3
to start with list number 3. But because of the code block in between markdown starts this list item as a new list.
Note that there are also a number of extensions available that will fix this behaviour for specific contexts of Markdown use.
For example, sane_lists extension of python-markdown (used in mkdocs, for example), will recognize numbers used in Markdown lists. You just need to enable this extension arkdown.markdown(some_text, extensions=['sane_lists'])