Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

Required fields*

7
  • 5
    It is definitely the final intent for toggling back/forth to be a relatively non-destructive action (for the vast majority of cases). However, this is a lot harder than it may seem. We have a lot of these cases laid out in our automated testing suite, with a number of them currently failing. Every time we come across a new edge case, we add a unit test ;). We're working to close the gap, but there's still quite a bit of work left to do so. Thanks for the suggestion! Commented Jan 29, 2021 at 21:45
  • 19
    @BenKelly: Then it seems that there's something wrong with the editor architecture. Source markdown text should be the single source of truth. And the rich text editor should be built on top of it, it should not have its own internal model that doesn't map to source text 1:1 (with all its spacing and formatting variations). Switching editor must be non-destructive always, since 1) it's going to be used as preview, 2) editing posts in editor that were written in md and vice versa will introduce source differences and ugly diffs otherwise Commented Jan 30, 2021 at 21:55
  • 3
    In practice, this is why I’ll likely end up just using post as my “preview”, since you can always make edits after posting. Commented Feb 1, 2021 at 19:31
  • @user: I doubt if that kind of architecture can be implemented. Markdown is plaintext so the editing part is simple and implementing preview is tough. For rich text the editing is tough and I guess some form of compilation goes on to convert from the internal rich text representation to markdown. But expecting the compiled markdown to match a natively written markdown will be difficult. Commented Feb 4, 2021 at 1:39
  • 3
    It seems to be implemented such that switching the editor mode immediately discards the contents in the other editor. A lot of this pain could be avoided if the other editor was simply hidden instead. It only needs to be discarded if an edit is made in the visible editor. If no edits are made, you could re-show the hidden editor and it would be guaranteed to be non-destructive. Commented Feb 10, 2021 at 11:54
  • @StephenOstermiller There already is a hidden textarea that contains the raw Markdown. Even then, the Markdown could simply be stored in a string — no need to use HTML at all. Commented Feb 10, 2021 at 14:06
  • 1
    This was completed in release Alpha 2 Commented Jul 12, 2022 at 14:16