MarkdownViewerPlusPlus icon indicating copy to clipboard operation
MarkdownViewerPlusPlus copied to clipboard

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

Open frank-mi-usa opened this issue 7 years ago • 2 comments

[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

  • Notepad++ 7.5.6 (64-bit)
  • MarkdownViewer++ 0.8.2
  • Windows 10 (64-bit)

frank-mi-usa avatar Jun 14 '18 16:06 frank-mi-usa

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

monoblaine avatar Jun 20 '18 10:06 monoblaine

@monoblaine , thanks a lot!

frank-mi-usa avatar Jun 29 '18 13:06 frank-mi-usa