bot icon indicating copy to clipboard operation
bot copied to clipboard

Single newlines in tags get rendered as-is in Discord

Open n0Oo0Oo0b opened this issue 1 year ago • 0 comments

According to the markdown spec, lines separated by a single newline should be joined with a space.

Discord embeds doesn't seem to respect this, as demonstrated by the !traceback tag:

https://github.com/python-discord/bot/blob/13927ec4791a3f87193724ea3d1ac24143a8684c/bot/resources/tags/traceback.md?plain=1#L5-L8

image

We could resolve this by formatting paragraphs on a single line, but I think joining the lines manually as the tag is loaded is better (something along the lines of re.sub(r"(?<!\n)\n(?!\n)", " ", content)) since it leaves open more formatting options.

n0Oo0Oo0b avatar Sep 13 '24 16:09 n0Oo0Oo0b