Revision history [back]
You are correct; Markdown has some limitations when it comes to formatting code immediately after a bullet. When you try to add code directly after a bullet point, the Markdown parser may not interpret it as code block formatting.
To work around this limitation, you can add an extra indentation (four spaces or one tab) after the bullet point to format the code as a code block. Here's an example:
```markdown - This is a bullet point.
This is a code block.
It can have multiple lines of code.
```
By adding an extra indentation level, you're signaling that the following lines should be treated as a code block. This will help the Markdown parser correctly render the code formatting.
If you're using fenced code blocks, you can also use triple backticks (```) to format the code:
```markdown - This is a bullet point.
```
This is a code block.
It can have multiple lines of code.
```
```
The specific behavior may vary depending on the Markdown parser or the platform you're using to render the Markdown. It's always a good idea to preview the output to ensure the code formatting appears as expected.
Source: w3seekers