cinnyapp / cinny

Yet another matrix client
https://cinny.in
GNU Affero General Public License v3.0
1.99k stars 259 forks source link

Markdown newlines are different from Element #193

Closed notramo closed 2 years ago

notramo commented 2 years ago

The original Markdown spec describes that newlines should be removed from the input, unless 2 spaces are appended at the end (line break), or more than 1 newlines (new paragraph). However, many applications use a different flavor, e.g. Github, or Element, where every newline is persisted as is. This is useful in instant messaging. Cinny should also preserve these line breaks. image image

samueldr commented 2 years ago

This is actually element being buggy.

See the discussion here:

TLDR: when there is no markdown in the input, element sends the input as plain text. If you use, e.g. *hi* in one of those lines, to force markdown, element will behave exactly as Cinny does.

ShadowJonathan commented 2 years ago

The original Markdown spec describes that newlines should be removed from the input

Could you give me a link to that?

samueldr commented 2 years ago

AFAICT it's not part of the original markdown spec as described in the first post of this issue.

It states that “A paragraph is simply one or more consecutive lines of text, separated by one or more blank lines”, nothing about two spaces to make a newline, which is a common extension from the original spec.

But I feel I need to remind everyone here that cinny is doing things right. It is element that has a buggy behaviour and sometimes sends plaintext messages. When there is markdown formatting other than linebreaks, element will behave differently.