nikola icon indicating copy to clipboard operation
nikola copied to clipboard

bad spacing on markdown bullet lists

Open alusiani opened this issue 2 years ago • 1 comments

Hi,

I see that bullet lists in Markdown have a bad extra vertical spacing between one bullet and a following second level bullet, like in this Markdown example

-   first bullet
    -   second indented bullet
    -   3rd ...

An example can be found at https://precision-sm.github.io/posts/precision-sm-hepdata-subm/

This vertical spacing is absent when exactly the same above text is instead in a RST file.

As far as I understand, when Markdown is converted to HTML one gets <ul> for lists, when RST is converted the same list begins with <ul class="simple">. The "simple" class triggers the CSS

.simple li, .simple ul, .simple ol, .compact li, .compact ul, .compact ol, .simple > li p, dl.simple > dd, .compact > li p, dl.compact > dd {
    margin-top: 0;
    margin-bottom: 0;
}

which is not triggered for <ul>. In this latter case the following CSS holds

p {
    margin-top: 0;
    margin-bottom: 1rem;
}

In my opinion it would be best if Markdown could produce the same formatting as RST.

I checked asciidoc: it behaves like Markdown.

Cheers,

Alberto

alusiani avatar May 06 '22 23:05 alusiani

We don't really control what markup is produced, but you can add a CSS tweak in assets/css/custom.css to make it look the way you want.

On Fri, May 6, 2022, 8:30 PM Alberto Lusiani @.***> wrote:

Hi,

I see that bullet lists in Markdown have a bad extra vertical spacing spacing between one bullet and a following second level bullet, like in this Markdown example

  • first bullet
    • second indented bullet
    • 3rd ...

An example can be found at https://precision-sm.github.io/posts/precision-sm-hepdata-subm/

This vertical spacing is absent when exactly the same above text is instead in a RST file.

As far as I understand, when Markdown is converted to HTML one gets

    for lists, when RST is converted the same list begins with
      . The "simple" class triggers the CSS

      .simple li, .simple ul, .simple ol, .compact li, .compact ul, .compact ol, .simple > li p, dl.simple > dd, .compact > li p, dl.compact > dd { margin-top: 0; margin-bottom: 0; }

      which is not triggered for

ralsina avatar May 06 '22 23:05 ralsina