You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Edit composer doesn't show the original markdown and can mess up the formatting of lists #13474
Sorry if this is a duplicate, I couldn't find any other issue about this.
For example, let's consider this message:
Here's a list:
1. foo
- bar
- baz
Which renders like this on Riot:
When sent, if I click the edit button, this is what appears in the edit composer:
Here's a list:
1. foo
- bar
- baz
Which doesn't have the same level of indentation, and also removed the blank line between the paragraph and the line (this latter point doesn't affect rendering here, but I've seen cases where it did).
If I edit this message (e.g. adding an extra r to bar) without fixing the markdown by hand, the message renders like this:
Without having any knowledge of how the composer works under the hood, it seems weird to me that it doesn't just show what's in the body of the original event.
I can't see any error in the console when showing up the composer.
changed the title [-]Edit composer doesn't show the original markdown and can mess up the formating[/-][+]Edit composer doesn't show the original markdown and can mess up the formatting of lists[/+]on Oct 5, 2021
I'm not sure this is fixed. It looks like the linked PR only fixes a symptom of this issue, which is the bad indentation of ordered lists.
If I send
Here's a list:
1. foo
* bar
* baz
and edit that message, the edit composer shows
Here's a list:
1. foo
- bar
- baz
which isn't the original markdown I sent. It's also not the markdown that's in the event's body (which does reflect what I originally sent).
I think this issue needs to be reopened (I seem to have lost perms to do this, which is probably a good thing, but means that I can't do it by myself anymore).
which isn't the original markdown I sent. It's also not the markdown that's in the event's body (which does reflect what I originally sent).
As per the spec, the body is a plaintext representation, not specifically markdown so it can't be trusted as such esp as markdown dialects can vary between clients. * and - are both list notations so are pretty much equivelant.
Oh right so it's not closed by matrix-org/matrix-react-sdk#7300 but as a duplicate of #10725 (now that the list formatting part of the problem is fixed). Gotcha, thanks :)
Activity
[-]Edit composer doesn't show the original markdown and can mess up the formating[/-][+]Edit composer doesn't show the original markdown and can mess up the formatting of lists[/+]robintown commentedon Mar 8, 2022
Fixed by matrix-org/matrix-react-sdk#7300
babolivier commentedon Mar 8, 2022
I'm not sure this is fixed. It looks like the linked PR only fixes a symptom of this issue, which is the bad indentation of ordered lists.
If I send
and edit that message, the edit composer shows
which isn't the original markdown I sent. It's also not the markdown that's in the event's
body(which does reflect what I originally sent).I think this issue needs to be reopened (I seem to have lost perms to do this, which is probably a good thing, but means that I can't do it by myself anymore).
t3chguy commentedon Mar 8, 2022
As per the spec, the
bodyis a plaintext representation, not specifically markdown so it can't be trusted as such esp as markdown dialects can vary between clients.*and-are both list notations so are pretty much equivelant.robintown commentedon Mar 8, 2022
What @t3chguy said, but there are also #10725 and element-hq/element-meta#1493 to track the more general idea of preserving Markdown verbatim
babolivier commentedon Mar 9, 2022
Oh right so it's not closed by matrix-org/matrix-react-sdk#7300 but as a duplicate of #10725 (now that the list formatting part of the problem is fixed). Gotcha, thanks :)