-
-
Notifications
You must be signed in to change notification settings - Fork 844
Closed
Labels
Description
Description
MD046 incorectly flags all fenced code blocks as violations even if they are a part of lists.
Motivating example:
1. Here is my list item
```bash
# example code
```
2. Here is my next list item.which I expect to render as follows:
-
Here is my list item
# example code -
Here is my next list item.
The vscode markdownlint extension flags this as a violation of MD046 but if I follow the advice on the MD046 wiki page then I get the following rendering:
Example following MD046 advice:
1. Here is my list item
```bash
# example code
``` <!-- space added here to prevent rendering errors in comment-->
2. Here is my next list item.Rendered result:
- Here is my list item
# example code- Here is my next list item.
which is not how I want the list to appear in its rendered form.
Possible Resolutions:
It seems like there are two approaches that could be used to fix this issue:
- broaden MD046 to allow for these cases when in lists. (both formations are valid so it probably just needs to be disabled when immediately following list items (ordered or unordered)
- Allow the visual studio code extension to ignore specific violations.
MichaIng and yuriever