yogthos / markdown-clj

Markdown parser in Clojure
Eclipse Public License 1.0
540 stars 120 forks source link

Seperate lines being squashed. #119

Closed rjb25 closed 7 years ago

rjb25 commented 7 years ago

If I have two sentences in a mardown file like so: hey how are you? Good How about you? It translates to: hey how are you?Good How about you? Is this intentional? Why ignore line breaks? And if you are going to ignore them at least put a space between line content.

rjb25 commented 7 years ago

This may be an error with the implementation (of cryogen) not passing line breaks to markdown-clj

yogthos commented 7 years ago

That is how the reference implementation handles this. When a new line is added there is a space inserted between the concatenated content as seen in the tests here.

yogthos commented 7 years ago

Also, I wasn't able to replicate the issue with Cryogen. When I have text on separate lines, it's joined with a space.

rjb25 commented 7 years ago

It appears the issue only starts after a code block with an empty line before it. like: hey

``` hello ``` no space

TURNS INTO

hey

hello

nospace

rjb25 commented 7 years ago

Another issue is that this: hey ``` hello ```

**TURNS INTO***

hey

hello

Note the excess space at the end. These issues might be linked.

yogthos commented 7 years ago

You're right, the code blocks should work without space around them. The current workaround would be to put space before and after the code blocks for consistent behavior.

yogthos commented 7 years ago

I'll take a look at this when I get a chance, but if you'd like to take a look in the meantime feel free to make a pr. :)

rjb25 commented 7 years ago

Is your flexmark parser going to deprecate markdown-clj? I do not want to go to the trouble if it will.

yogthos commented 7 years ago

It's not going to deprecate it as they both have their pros and cons. However, if flexmark works better for you, then I would recommend switching to it.

rjb25 commented 7 years ago

Ok, I will give a crack at fixing this bug then.

yogthos commented 7 years ago

fixed by https://github.com/yogthos/markdown-clj/commit/435fc0a08c36bfacffa4ff62b4fe6ee86d876feb