progsource / maddy

C++ Markdown to HTML header-only parser library
MIT License
194 stars 39 forks source link

breaklineparser: First version #25

Closed patrickelectric closed 4 years ago

patrickelectric commented 4 years ago

Some markdown provides such as GitHub that uses \r\n to create

Signed-off-by: Patrick José Pereira patrickelectric@gmail.com

progsource commented 4 years ago

Thank you for your contribution!

Regarding https://github.github.com/gfm/#hard-line-break GitHub uses either 2 or more spaces at the end of a line or a backslash. I would actually prefer it that way. \r could create a problem depending on the editor and system you write your markdown in. Also it might not be so easy to use for the end-user.

Additionally it would be nice, to add new features always also to the documentation readme, because "if there is no documentation, it doesn't exist" ;)

patrickelectric commented 4 years ago

@progsource If you take a look in the releases content of github API, the body markdown does not contains empty spaces before the break line:

"body": "**Test Release (t2.0.5)**\r\n**Corrections and features around v2.0.4**\r\nChanges since last version:\r\n - Add mavlink integration with Ping360 chart\r\n - Add up and down connection speed in debug window\r\n - Improve Ping360 finder capabilities with different network interfaces\r\n - Increase A-Scan resolution\r\n - Higher Ping360 chart resolution\r\n - Better Ping360 render\r\n - Faster Ping360 scan time\r\n - Stronger stability with code fixes\r\n - Save last manual connections to be scanned in the next session\r\n - Fix application crash when closing\r\n - Fix Ping360 chart when running in lower range\r\n "

You can check the rendered markdown by GitHub here: https://github.com/bluerobotics/ping-viewer/releases/tag/t2.0.5

This patch do the same render as the GitHub website, if this patch is not valid, how can we make maddy to provide the same behavior as the website ? I don't see the problem to render \r\n as breaklines since this is what is happening here.

progsource commented 4 years ago

Ah okay - didn't know that. Thanks for the example.

In that case let's do it ;) (maybe adding the option for the user to write \ at the end of a line could still be a thing - optional)

I'll accept it, if the documentation readme is updated accordingly ;)

patrickelectric commented 4 years ago

@progsource done