mautrix / discord

A Matrix-Discord puppeting bridge
https://go.mau.fi/mautrix-discord
GNU Affero General Public License v3.0
253 stars 21 forks source link

Markdown escaping is a bit broken #37

Open baltitenger opened 1 year ago

baltitenger commented 1 year ago

A few examples:

Discord doesn't need escaping inside inline code

Sending `foo_bar_baz` on matrix is shown as foo\_bar\_baz on discord

Discord allows single line code blocks

```foo``` sent on discord is displayed as a code block, but on matrix it's shown as inline code, as if `foo` was sent.

Discord allows closing code blocks on a nonempty line

``​`
foo
bar```
baz

displays as

foo
bar

baz

but on matrix, it's shown as

foo
bar```
baz

If the first line contains spaces, discord assumes it's not a language specifier

```foo bar
baz qux```

should be displayed as

foo bar
baz qux

but what's bridged is

baz qux```

Markdown features not supported by discord shouldn't be converted (discord->matrix direction)

I personally don't think it makes sense to convert something like + foo to a bullet point on matrix, the person sending it on discord almost certainly didn't intend it as such.