There is really Markdown, but it's in Messages, which is why one line break now looks like a space in messages.
Again, sorry. If anyone could find a good enough text formatting implementation that works in Django, let me know.
I don’t know the Python/Django ecosystem very well, but after searching, it looks like the paka.cmark Python library does what you need. It implements the CommonMark standard, so it supports all the features of Markdown. And its README shows that it supports converting soft line breaks to <br>s with breaks="hard":
I didn’t look for a library that specifically integrates paka.cmark with Django, as your current library django-markdown-deux does, but I don’t think you need such a library to use paka.cmark in your app. When I wrote a Ruby on Rails app that rendered Markdown, it was easy enough to write my own function to render Markdown. It just did these two things:
With a library like CommonMarker, convert the Markdown to HTML.
With another library like Sanitize, sanitize the HTML, keeping only whitelisted HTML elements and attributes. So no <script> or <style> tags.
Then you include that raw HTML in your view, marking it as safe.
You requested help finding a good Markdown library in the Closedverse FAQ:
I don’t know the Python/Django ecosystem very well, but after searching, it looks like the
paka.cmark
Python library does what you need. It implements the CommonMark standard, so it supports all the features of Markdown. And its README shows that it supports converting soft line breaks to<br>
s withbreaks="hard"
:I didn’t look for a library that specifically integrates
paka.cmark
with Django, as your current library django-markdown-deux does, but I don’t think you need such a library to usepaka.cmark
in your app. When I wrote a Ruby on Rails app that rendered Markdown, it was easy enough to write my own function to render Markdown. It just did these two things:<script>
or<style>
tags.Then you include that raw HTML in your view, marking it as safe.