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. Is there any way to prevent that behaviour?
Desired output:
1. item 1 2. item 2 ``` Code block ``` 3. item 3
Produced output:
Code block
Headings. To create a heading, add number signs ( # ) in front of a word or phrase. The number of number signs you use should correspond to the heading level. For example, to create a heading level three ( <h3> ), use three number signs (e.g., ### My Header ).
As a workaround I would suggest inserting a vertical bar (|) followed by hard spaces (Alt-Code on Windows: Alt+0160). This preserves the indent after the bar resulting in a visually acceptable solution for raw and rendered Markdown. This is a normal line of text. | This is an indented line of text.
There are two ways to format code in Markdown. You can either use inline code, by putting backticks (`) around parts of a line, or you can use a code block, which some renderers will apply syntax highlighting to.
Use four spaces to indent content between bullet points
1. item 1 2. item 2 ``` Code block ``` 3. item 3
Produces:
item 2
Code block
As an extension to existing answers. For those trying to continue a numbered list after something other than a code block. For example a second paragraph. Just indent the second paragraph by at least 1 space.
Markdown:
1. one 2. two three 3. four
Output:
one
two
three
four
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With