nea / MarkdownViewerPlusPlus

A Notepad++ Plugin to view a Markdown file rendered on-the-fly
MIT License
1.17k stars 143 forks source link

In numbered list unneeded newline after item number #47

Closed crystalfp closed 6 years ago

crystalfp commented 6 years ago

Rendering a simple numbered list with a blank line between items gives (on screen and in pdf but not in html) an unwanted newline after the item number (see first screen capture below). Instead, without blank line gives the correct list rendering (see second screen capture below). Bug or feature? Thanks for looking! mario

capture1 capture2

nea commented 6 years ago

Hey @crystalfp

You are not the first seeing this issue but it is not affecting everyone. I have one colleague seeing the same, another facing no issues, same as me.

I will have to put some time into this.

Sorry

DavidBruchmann commented 6 years ago

When exported to HTML the fault is not visible, but when exported to PDF. In HTML it still could be influenced easily by CSS anyway ... Just tested with the x86 Version on 64b-Windows-7, UTF-8 and different line-breaks (CR, LF, CR LF).

DavidBruchmann commented 6 years ago

Example-Image with "display all characters" shows that after the list there is an issue too.

screenshot_md_notepad

nea commented 6 years ago

Hi @DavidBruchmann

What do you mean with "after the list is an issue"? If you mean that there is no line break: that is by CommonMark specification and standard. After a list, two spaces are not enough to line break but only a complete new line to result in a spacing between list and new line.

Best

DavidBruchmann commented 6 years ago

If I'm not wrong the list should end before line three because lines 3 and 4 are not indented.

nea commented 6 years ago

Hi @DavidBruchmann

As you can check yourself, it doesn't depend on line indentation in this case but real line breaks. You can test it yourself here: http://spec.commonmark.org/dingus/?text=-%20a%0A-%20b%0A%0A%20%20%5Bref%5D%3A%20%2Furl%0A-%20d%0A

This is an example based on the implemented spec 0.27.

Best

DavidBruchmann commented 6 years ago

Hi @nea,

ok, it seems that to end a list I've to make two "real" linebreaks. If only one the next line is still seen as part of the list. http://spec.commonmark.org/dingus/?text=-%20a%0A-%20b%20%20%0Acvb%0A%0A%20%20%5Bref%5D%3A%20%2Furl%0A-%20d%0A

Greets, David

Stevoisiak commented 6 years ago

I've encountered a similar issue (#57) when adding lists and reference-styled URLs.

- Hyperlink to [Google.com][1]

  [1]: https://www.google.com/

Reference-styled URL/list issue

nkaleidoskop commented 6 years ago

I also consistently see this bug whenever there are two lists separated by a blank line.

* foo
* bar

* cat

Creating a non-list-line between the lists prevents the bug.

Surprisingly, the following will not trigger the bug (note the different bullet point):

* foo
* bar

- cat

Hope this helps with finding the bug!

nea commented 6 years ago

Hi @crystalfp, @Stevoisiak

I just released a new version 0.8.0.

Could you please check if this issue still occurs?

Thanks a lot

crystalfp commented 6 years ago

Seems fixed in 0.8.0 but only if you do not leave an empty line between list entries. Here is an example:

Approfondiamo.

1. Vi ho trovato paralleli.

2. Ho visto i risultati.

3. C'è il mio interesse.

Voglio provare.

- 001 piano

- 002 la premessa

- 003 questi paralleli

If you remove the empty lines between the list items the rendering is perfect.

nea commented 6 years ago

Hey @crystalfp and thanks for cheking

Please refer to https://github.com/nea/MarkdownViewerPlusPlus/issues/39#issuecomment-305716146 why this happens because of the loose lists.

Thanks

Stevoisiak commented 6 years ago

@nea The spacing bug still occurs in 0.8.1 if a code-block is inserted after a list item.

Sample .MD file

- List item followed by code block

        print("Hello, world!")

Appearance on GitHub

Appearance in MarkdownViewer++

MarkdownViewer++: Spacing bug with bulleted list and code block

nea commented 6 years ago

Hi @Stevoisiak

It is a loose list why this behaviour occurs. I haven't changed or fixed anything in this regard as it mainly works as implemented but not as expected ^^

Best

Stevoisiak commented 6 years ago

@nea Should I open a separate issue report for this?

nea commented 6 years ago

Hi @Stevoisiak

You can but this is nothing I can tackle very soon as this depends on the background HTMLRendering, which is not further developed at the moment and would require me to step in there, when I find time.

Sorry