cocalc icon indicating copy to clipboard operation
cocalc copied to clipboard

markdown input: @mentions aren't preserved if you switch back and forth between Text/Markdown mode

Open williamstein opened this issue 3 years ago • 1 comments

  1. Type somewhere, e.g., markdown cell or chat message and set the mode to "Markdown".
  2. Use an @mention
  3. Change the mode to "Text" before submitting.

The @mention is lost.

Going in the other direction, from Text to Markdown (and back then) does work. It's just switching from Markdown to Text that fails. This is fixable.

This is somewhat important since people should be able to safely switch to Markdown if they need to do something subtle that the graphical slate editor doesn't support, then switch back. That works fine. But they might also type a mention in the Markdown mode (or start there) and that doesn't.

williamstein avatar Mar 11 '23 20:03 williamstein

This is still a bug. In particular, mentions created in "Markdown" mode don't get preserved switching to text mode and back. Mentions made in "Text" mode definitely do get properly preserved. Putting a console.log in

src/packages/frontend/editors/markdown-input/mentions.ts

helps a lot with confirming this.

Note that this is going to be pretty painful and tedious to fix, with relatively little impact. It is of course fixable though.

williamstein avatar Sep 30 '24 21:09 williamstein