A bug has been reported where a newline within a bold string in HTML email content breaks the markdown parser in Discourse, causing incorrect rendering. The issue was observed in an email originally formatted as <b>@All, d</b><b>oes anyone have topics...</b>, which rendered as *@All, d**oes anyone have topics they would like to discuss on today's call?* — breaking the bold styling due to the newline. downey provided the raw email and rendered output, while elberet helped retrieve the post’s raw text via /raw/#{topic_id}/#{post_number}link, confirming the newline was present in the cooked result but not the original email. elberet noted this is a legitimate parser bug since markdown does not allow inline formatting (like bold or italic) to span across block boundaries — a design choice to avoid ambiguity between paragraphs and list items. cawas contrasted this with their own issue involving post length limits and editor rendering differences, clarifying this is purely a markdown parsing behavior triggered by newlines. The consensus is that while the parser’s behavior is intentional, the presence of the newline in the cooked output — despite not being in the raw email — indicates a flaw in the email-to-markdown conversion process.
Oh, there’s a newline between today's and call, hence the markdown parser doesn’t apply the inline styling. I wonder how the newline got there since it’s not in the raw email text?
Anyway, looks like a legit bug in the email parser to me.
I think this is very different from my case. I believe my case is more related with some kind of overflow and the difference between the preview md renderer and the post md renderer… Also it happened after I’ve edited the email in, so it must not be directly related with the email renderer or HTML conversor… Although this is also not either one’s fault!
IMHO this is all a simple markdown issue, which I’m not sure if it’s by design. If it is intented to be like that, well, then it is indeed a problem with the HTML / email conversor.
So, if there is a new line the markdown renderer does break the formatting. You can try it right here, right now:
*for broken
example*
renders to:
for broken
example
while
*for working example*
renders to:
for working example
The only difference there is the break line before example.
Yes, it is. Here it’s a superfluous newline, in your case it’s something else, but at first glance both cases looked as if potentially valid markdown simply didn’t get cooked.
The markdown parser’s behavior is indeed by design. Each line is considered a block and inline-styles cannot span across blocks. This is because the inline parser cannot know whether the two lines will turn into a single paragraph or, for instance, two list items…