borkdude / quickblog

Light-weight static blog engine for Clojure and babashka
https://blog.michielborkent.nl/
MIT License
165 stars 28 forks source link

Literal <code> block drops white-space #72

Open kimo-k opened 10 months ago

kimo-k commented 10 months ago

Markdown input:

<pre>
<code>
(def newline-should-start
    :here)
</code>
</pre>

Expected output (should work the same as a markdown code-block literal): "<pre><code>&#40;def newline-should-start\n :here&#41;</code></pre>"

Actual output: "<pre> <code> (def newline-should-start :here) </code> </pre>"

borkdude commented 10 months ago

I think this should be an upstream issue with markdown-clj?

On Sun, 5 Nov 2023 at 16:44, kimo-k @.***> wrote:

Markdown input:


(def newline-should-start
    :here)

Expected output (should work the same as a markdown code-block literal): "

(def newline-should-start\n :here)
"

Actual output: "

  (def newline-should-start :here)  
"

— Reply to this email directly, view it on GitHub https://github.com/borkdude/quickblog/issues/72, or unsubscribe https://github.com/notifications/unsubscribe-auth/AACFSBTYGZKABIP3WWNB33TYC6X4NAVCNFSM6AAAAAA66NKOI6VHI2DSMVQWIX3LMV43ASLTON2WKOZRHE3TOOBUGM3TEOA . You are receiving this because you are subscribed to this thread.Message ID: @.***>

kimo-k commented 10 months ago

Looking over markdown-clj, I think you're right:

https://github.com/yogthos/markdown-clj#limitations

I guess that means quickblog is incompatible with cljs-showcase when it comes to multiline code snippets, since there's no way to write a markdown code block that will emit an html attribute (other than style="lang-clojure"). I wonder what workarounds are possible. Would you consider making quickblog's markdown parser pluggable?

borkdude commented 10 months ago

I'm open to that, but I don't know any markdown parser that is bb compatible other than markdown-clj