I have written a big chunk of the markdown_to_html function at this point, I can try to take a look at this. A situation like this isn't anything we have added to the function, so it must be how the markdown2 python library we are using is interpreting things. Ideally, this is the behavior I would want for line breaks.
PieFed Meta
Discuss PieFed project direction, provide feedback, ask questions, suggest improvements, and engage in conversations related to the platform organization, policies, features, and community dynamics.
Wiki
Yes, markdown_to_html() in app/utils.py sets the breaks of markdown2 to on_newline.
From the documentation (in the source file): on_newline: Replace single new line characters with <br> when True
(WOW! I missed escaping the <br> and it made a line break in the preview?)
Yep, I just made a PR. I am so used to the more normal way markdown works that I never actually ran into this issue before. I am not sure if this change might break something else in the codebase since markdown_to_html is used in lots of places, so I will let @rimu@piefed.social review it instead of just merging it myself.
Yes, it gets used for emails, too. Server admins would need to change their email texts. That's bad. But at this time the number of instances with PieFed is still below 1,000.
It's not like there is markdown standard. 🙃
Yes it's bit of a mess. But we should try to have the same markdown quirks as Lemmy.
Putting standards aside, I personally prefer aligning with Lemmy.
On my own server, I handle it in the following way, though I understand this is largely a matter of personal preference.
https://codeberg.org/karasugawasu/pyfedi/src/branch/main/app/utils.py#L666
Unsure if PieFed is the same, but double space in my instance adds a simple line break, while double enter adds a blank line between paragraphs. And in both cases, they need to be added manually. Maybe it's a similar situation on PieFed instances?

