Fix empty line before list
See original GitHub issueIt seems that the change in 0.3.15 introduced an empty line before a list, which seems semantically unintuitive.
For example:
/**
* A description.
*
* @param {any} var An example list:
* - Item 1
* - Item 2
* - Item 3
* @returns {Promise} A return value.
*/
turns into:
/**
* A description.
*
* @param {any} var An example list:
*
* - Item 1
* - Item 2
* - Item 3
* @returns {Promise} A return value.
*/
This seems semantically unintuitive, because a list rarely stands on its own, unless it is an index or table of contents.
If a list should be more clearly separated from the rest, it should add an empty line before and after the list. But that would be even worse in my opinion, because it takes up even more space. And the list cannot really be optically attached to the previous or following line anymore. For example, here the list seems pretty lost:
/**
* A description.
*
* @param {any} var An example text that is
* long and spans multiple lines
* followed by a list.
*
* - Item 1
* - Item 2
* - Item 3
*
* And more text to come.
* @returns {Promise} A return value.
*/
My suggestion would be to:
- not auto-add an empty line before or after the list
- respect if the author added an empty line before or after a list and do not remove it
- reduce the number of empty lines to 1 if the author added more than 1 empty line before or after the list
Issue Analytics
- State:
- Created 2 years ago
- Comments:15 (9 by maintainers)
Top Results From Across the Web
Blank lines before lists, revisited - CommonMark Discussion
One solution that can work is for block quote to be logically extended until a blank line. This way any lines not separated...
Read more >Explain that lists and bullets require empty line before #46
When using markdown in the real world, one common and frustrating issue when using bullets and lists is that a blank line is...
Read more >rule-empty-line-before - Stylelint
This rule ignores rules that are the very first node in a source. The fix option can automatically fix all of the problems...
Read more >R Markdown: Empty line between list items - Stack Overflow
When using ordered lists, I sometimes run into a case where no empty line is added between the list item. That happens after...
Read more >List Markdown doesn't work unless preceded by a blank line
It would take one line in the Markdown reference to fix. I realize that there is a limit on how much detail you...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found

I will do it as soon as possible. Thank you for contributing.
Yes, now I see it too, let’s go with a) then. I think the only issue to correct is that there is no empty line after the list if the next line starts with a tag.
should become