macdown icon indicating copy to clipboard operation
macdown copied to clipboard

Spacing is inconsistent in bullet points

Open stevebissett opened this issue 8 years ago • 6 comments

Raw Text

- Males 
  - (150 males, 0 females)
- Aged 18 - 24 years 
  - (150 in this age group, 0 in other age groups)
- Recent Beer Consumers (P30D)
  - (150 beer drinkers)
- Recent Beer Consumers (P30D)
  - (150 beer drinkers)
- Recent Beer Consumers (P30D)
  - (150 beer drinkers)

Screenshot 1: screen shot 2016-11-25 at 10 38 53 am

Screenshot 2:

screen shot 2016-11-25 at 10 38 48 am

We can see in the second screenshot that the text for the last two entries is the same, but the preview is not.

EDIT:

The problem only occurs before another numbered or bulleted list.

screen shot 2016-11-25 at 10 44 20 am screen shot 2016-11-25 at 10 44 12 am

stevebissett avatar Nov 25 '16 08:11 stevebissett

I think this is the same as or closely related to #640.

You can see in the HTML that the renderer is putting <p> tags around that last list item when it's followed by another list, almost as if it were doing a loose list there instead of recognizing that there are two different lists going on. Note that this happens without the sub-lists too. Here's the html code where you can see the extra tags:

<ul>
<li>Males 

<ul>
<li>(150 males, 0 females)</li>
</ul></li>
<li>Aged 18 - 24 years 

<ul>
<li>(150 in this age group, 0 in other age groups)</li>
</ul></li>
<li>Recent Beer Consumers (P30D)

<ul>
<li>(150 beer drinkers)</li>
</ul></li>
<li>Recent Beer Consumers (P30D)

<ul>
<li>(150 beer drinkers)</li>
</ul></li>
<li><p>Recent Beer Consumers (P30D)</p>

<ul>
<li>(150 beer drinkers)</li>
</ul></li>
</ul>

<ol>
<li>some numbered list</li>
</ol>

Note that pandoc recognizes that a numbered item starts a new list and isn't a continuation, so it doesn't put in the extra tags. Here's the pandoc output where there are no <p> takes:

<ul class="incremental">
<li>Males</li>
<li>(150 males, 0 females)</li>
<li>Aged 18 - 24 years</li>
<li>(150 in this age group, 0 in other age groups)</li>
<li>Recent Beer Consumers (P30D)</li>
<li>(150 beer drinkers)</li>
<li>Recent Beer Consumers (P30D)</li>
<li>(150 beer drinkers)</li>
<li>Recent Beer Consumers (P30D)</li>
<li>(150 beer drinkers)</li>
</ul>
<ol class="incremental" style="list-style-type: decimal">
<li>new list maybe</li>
</ol>

So this is hoedown bug, no?

Jmuccigr avatar Nov 26 '16 16:11 Jmuccigr

@Jmuccigr Yes, exactly. This is Hoedown bug. This is fixed in their develop branch, so it will be fixed in MacDown in the future.

details

Minimal working example to reproduce the bug:

- Males
- Aged 18 - 24 years
- Recent Beer Consumers (P30D)

1. foo

MacDown, as well as master branch of Hoedown, gives

<ul>
  <li>Males</li>
  <li>Aged 18 - 24 years</li>
  <li><p>Recent Beer Consumers (P30D)</p></li>
</ul>

<ol>
  <li>foo</li>
</ol>

Notice that the third bullet point is surrounded by <p>, increasing the spacing. This makes the spacing between first and second different from the one between second and third. Thus it is rendered

screen-shot

And this is fixed in their develop branch, so we have to wait until it becomes stable.

FranklinYu avatar Nov 26 '16 19:11 FranklinYu

I'm seeing a similar issue where the 2nd-level unordered list items have a space below them, however this is only a problem on specific rendering themes. It is a problem on "GitHub2" but not on "GitHub". The two "Solarized" themes have the problem but to a much lesser degree (less of a space). "Clearness" works fine too.

Would be nice to see GitHub2 fixed.

philfreo avatar Aug 15 '17 18:08 philfreo

This seems still to be a problem, no? Has it made it to the stable branch of hoedown?

I think there's also a related problem when you have a list with a nested list. If the last item in the main list is formatted, the nested list gets the extra spacing. The html looks fine (though the "uno" gets quoted), but the spacing is off: screenshot 2018-07-31 14 29 52

Jmuccigr avatar Jul 31 '18 21:07 Jmuccigr

I am seeing this as well. Makes the docs look very strange. +1 to fix as a priority.

ebergerson avatar Nov 13 '18 14:11 ebergerson

What's the status of this bug? There hasn't been any progress in hoedown for years.

normanius avatar Jul 19 '22 17:07 normanius