atom / markdown-preview

📝 Markdown preview in Atom
MIT License
1.23k stars 358 forks source link

Task lists are rendered with dot #166

Open bouzlibop opened 9 years ago

bouzlibop commented 9 years ago

When using task list on github there are no dots in front of the list items:

Here is what I get in the markdown previewer:

screenshot from 2014-12-19 14 21 28

Atom v0.162.0, Ubuntu 14.04 | Markdown Preview v0.112.0

oivindoh commented 8 years ago

Seems like the problem is the no-list class isn't being applied to the tasklist <ul>s, but I can't for the life of me figure out where this is done.

harrisitservices commented 8 years ago

Same here. I have searched the code on github and can't find it anywhere.

harrisitservices commented 8 years ago

I think I just tracked this down to...

https://github.com/gjtorikian/task-lists-js/issues/5

swrobel commented 8 years ago

The alignment is also quite weird - the bullet ends up vertically aligned with the last line of wrapped text. Markdown:

* [ ] Display water quality data in some useful way (preferably only when there's a warning). Need to do some geo magic to pick the closest sampling spot or spots to a surf spot.

Rendered preview:

screenshot 2016-08-17 16 36 39
simurai commented 8 years ago

Will be fixed by #351 (once/if it gets merged)

brandoncurtis commented 7 years ago

I think we're talking about two different issues.

THIS issue, #166 - task lists are always rendered with dot, has been addressed by #351 (via #428) and should be closed.

@swrobel points out a different issue that was also mentioned in #142 - task lists with wrapping text show a bullet on the last wrapping line.

This is still a problem. This:

- [ ] A line that doesn't wrap. Everything is fine.
- [ ] A line that wraps once. You see the bullet in the second line? It shouldn't be there.
- [ ] A line that is long enough to cause some more line breaks to make clear everything is fine on all lines execpt the last one. See? There is no bullet on the middle lines but one on the last one. That bullet shouldn't be there.
- This is a standard bullet point created with "-". See, it's the same that gets shown on the last line of a bullet point with a checkbox. Here everything is fine.

Renders like this: task-bullets

atom@1.13.0 markdown-preview@0.159.1

inspection of the task list item in the preview:

<li><label>
  <input type="checkbox" class="task-list-item-checkbox">
   A line that is long enough to cause some more line breaks to make clear everything is fine on all lines execpt the last one. See? There is no bullet on the middle lines but one on the last one. That bullet shouldn't be there.
</label></li>

gjtorikian/task-lists-js#6 implements one way to solve this and describes another; in the meantime, adding this to styles.less will fix this problem (though it may cause other weirdness elsewhere!):

label {
  vertical-align: top;
}
simurai commented 7 years ago

Adding a task-list-item class to the <li>s seems to be safest: https://github.com/gjtorikian/task-lists-js/issues/5. Then we can remove the bullet instead of trying to cover it with the checkbox.

@brandoncurtis Nice short-term fix with aligning the label. ✌️