Canop / termimad

A library to display rich (Markdown) snippets and texts in a rust terminal application
MIT License
903 stars 31 forks source link

Lone newlines not interpreted as space #54

Open sidju opened 10 months ago

sidju commented 10 months ago

Commonly in markdown a single newline is interpreted as space (and often indentation on the next line ignored). This is to allow keeping one's markdown source limited to 80 columns without limiting the width it can be printed as. Instead two consecutive newlines are treated as a new paragraph.

As I have 80 column markdown source and would like to be able to print it wider than that I quite miss this feature.

From a quick look at your codebase it is either that a user will need to modify their input markdown before giving it into either of MadView or TextView (the workaround I'll be using for now) or the library can handle it when splitting the markdown string into lines. I'll see if I can throw together a suggestion for how to do this.

sidju commented 10 months ago

https://github.com/Canop/termimad/pull/55

In case someone else comes here. We have communicated out of band and this is the PR for a md aware joiner, which may be plugged in somewhere or may be just exported for library users to run if they wish.