yzhang-gh / vscode-markdown

Markdown All in One
https://marketplace.visualstudio.com/items?itemName=yzhang.markdown-all-in-one
MIT License
2.91k stars 322 forks source link

Missing bottom margin while list has only one item #1222

Closed afxres closed 1 year ago

afxres commented 1 year ago

What's the problem

Missing bottom margin while list has only one item image

Missing <p> tag on printed HTML file image

What's the expected result

Bottom margin should shown normally

How to reproduce

Simple markdown like this

- Item 1
  - Sub Item 1-1  
    Some Text

- Item 2
  - Sub Item 2-1  
    Some Text

  - Sub Item 2-2  
    Some Text

- Item 3

Other information

N/A

yzhang-gh commented 1 year ago

This is the CommonMark spec. Please find more information here https://spec.commonmark.org/0.30/#why-is-a-spec-needed- (point 4, and search for "loose" list)

And an online demo

afxres commented 1 year ago

So, is this a CSS issue? Some online editor (like stackedit.io and markdowntohtml.com) has set both margin-top and margin-bottom on <p> elements. image image But, in this plugin generated HTML file, only margin-bottom was set on <p> elements image

yzhang-gh commented 1 year ago

I meant the generated HTML (<p> or not) is as designed (by the Markdown spec).

With CSS, you can have different looking for the same HTML. This extension simply uses the VS Code's default CSS. You can change it with your own CSS files, or other VS Code extensions^1. They will be included when exporting HTML using this extension.

afxres commented 1 year ago

Thanks