obsidian-share-as-gist icon indicating copy to clipboard operation
obsidian-share-as-gist copied to clipboard

newline gets rendered differntly in gist compared to obsidian

Open seb-mueller opened this issue 1 year ago • 2 comments

Thanks for the nice plugin, it really works well. I however noticed that subsequent lines in markdown get rendered as one line when viewing the gist, whereas they are rendered as separate lines in obsidian. So the note basically looks completly scrambled in gist. This seems expected behaviour in github gist and according to [1] and [2] a solution is the add 2 spaces at the end of lines. However this is impractiacal to do. Is there a way around this problem without adding 2 spaces?

[1] https://stackoverflow.com/questions/51049503/github-markdown-that-respects-newlines [2] https://stackoverflow.com/questions/47123835/is-it-possible-to-break-a-line-on-gist

seb-mueller avatar Dec 15 '23 11:12 seb-mueller

Thanks for reaching out with your thoughts and feedback!

I would agree that adding the extra spaces on our side is impractical. I think it will be hard to know what is a "real line break" (which should be doubled) and what is a "fake line break" (e.g. in a code block or a numbered list).

I don't have a great idea of what to do here, but I'll think about it a bit more.

timrogers avatar Dec 15 '23 17:12 timrogers

Thanks for your feedback, indeed, I wouldn't know how the best approach. Maybe inspiration can be drawn from obsidian itself since it somehow manages render the markdown correctly?

seb-mueller avatar Dec 19 '23 08:12 seb-mueller