yogthos/markdown-clj

Newlines are not rendered correctly in line with "[]"

borkdude opened this issue · 9 comments

Input as clojure block of code:

(let [x 1
      y "[]"
      ])

This renders as:

(let [x 1       y "[]"
      ])

It seems the "[]" string is triggering something weird.

That looks like a bug, using ``` might be a workaround at the moment. Looks like might need a bit more intelligence here. If you have a chance to take a look a PR would be very welcome. :)

@yogthos I am already using ``` at the moment, this is within such a block. I'm running into this while trying to rewrite my octopress blog in babashka using bootleg.

Hmm, in theory the parser should avoid any processing when it's in the codeblock state.

I'm noticing the quotes aren't relevant here either btw.

Could it be something with the newline character?

Oops, sorry to bother you, it was introduced by a workaround I did for another issue where I tried to support

[foo]
(https://bar)

on multiple lines which some markdown parsers do support. And this workaround caused the above bug.

Ah no worries. :)

It was actually this that I tried to support:

[Small Clojure
Interpreter](https://github.com/borkdude/sci)

Oh yeah, that would take a bit of rework for the parser. Right now it considers input line by line, and I was thinking it might make sense to aggregate lines within paragraphs into a single line before doing the rest of processing. Never got around to doing it though. :)