ttscoff / mdless

MIT License
871 stars 39 forks source link

mdless adds blank lines before and after content #63

Closed atsaloli closed 3 years ago

atsaloli commented 3 years ago

Hello,

Thanks for a great tool! Very useful.

Why are there blank lines inserted in mdless output before and after the main content?

For example:

[root@localhost source]# cat /tmp/example.md
# header

text
[root@localhost source]# mdless /tmp/example.md

header ============================================================================================================================================================================================================

text

[root@localhost source]#

Put another way:

[root@localhost source]# wc -l /tmp/example.md
3 /tmp/example.md
[root@localhost source]# mdless /tmp/example.md | wc -l
8
[root@localhost source]#

The extra blank lines at the bottom are causing content to scroll off my screen.

atsaloli commented 3 years ago

I can work around it with GNU head:

[root@localhost source]# mdless /tmp/example.md | head -n -4

header ============================================================================================================================================================================================================

text
[root@localhost source]#
ttscoff commented 3 years ago

Version 1.0.17 is pushed for gem update now, and should remove at least the extra space at the top.

atsaloli commented 3 years ago

Very nice, thank you @ttscoff