nea / MarkdownViewerPlusPlus

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

[Bug Report] One Extra Line at the End of Code Block #82

Open frank-mi-usa opened 6 years ago

frank-mi-usa commented 6 years ago

[Bug Report] One Extra Line at the End of a Code Block

The markdown viewer renders code block with an extra line at the end.

Markdown to reproduce

Some Stuff...
```
import java.util.*;
class Mydate extends java.util.Date {
}
```
Other Stuff...

Screenshot

If I don't set a custom CSS, it looks like: capture1 If I use a Github Style Markdown CSS, it looks more clearly that there is an extra line at the end of the code block: capture2

Environment

monoblaine commented 6 years ago

Hi @frank-mi-usa I had the same problem but it's not directly related to MarkdownViewerPlusPlus itself. The problem is with the markdig package (The one that converts markdown code to html). It adds extra new lines while creating a code block, and because the code blocks are rendered as pre elements, each extra new line gets rendered in the output. I should probably create a pull-request for markdig, but didn't have time to.

Here is the fix in my fork:

https://github.com/monoblaine/markdig/commit/260389ee407839cd2aedece16007f3fc9e1ff784

frank-mi-usa commented 6 years ago

@monoblaine , thanks a lot!