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*
- 5It 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!Ben Kelly– Ben Kelly StaffMod2021-01-29 21:45:03 +00:00Commented 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 otherwiseuser– user2021-01-30 21:55:56 +00:00Commented Jan 30, 2021 at 21:55
- 3In practice, this is why I’ll likely end up just using post as my “preview”, since you can always make edits after posting.Noah Snyder– Noah Snyder2021-02-01 19:31:08 +00:00Commented 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.Paramanand Singh– Paramanand Singh2021-02-04 01:39:27 +00:00Commented Feb 4, 2021 at 1:39
- 3It 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.Stephen Ostermiller– Stephen Ostermiller2021-02-10 11:54:12 +00:00Commented 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.Sebastian Simon– Sebastian Simon2021-02-10 14:06:47 +00:00Commented Feb 10, 2021 at 14:06
- 1This was completed in release Alpha 2Yaakov Ellis– Yaakov Ellis StaffMod2022-07-12 14:16:27 +00:00Commented Jul 12, 2022 at 14:16
Add a comment |
How to Edit
- Correct minor typos or mistakes
- Clarify meaning without changing it
- Add related resources or links
- Always respect the author’s intent
- Don’t use edits to reply to the author
How to Format
- create code fences with backticks ` or tildes ~ ```
like so
``` - add language identifier to highlight code ```python
def function(foo):
print(foo)
``` - put returns between paragraphs
- for linebreak add 2 spaces at end
- _italic_ or **bold**
- indent code by 4 spaces
- backtick escapes
`like _so_` - quote by placing > at start of line
- to make links (use https whenever possible) <https://example.com>[example](https://example.com)<a href="https://example.com">example</a>
How to Tag
A tag is a keyword or label that categorizes your question with other, similar questions. Choose one or more (up to 5) tags that will help answerers to find and interpret your question.
- complete the sentence: my question is about...
- use tags that describe things or concepts that are essential, not incidental to your question
- favor using existing popular tags
- read the descriptions that appear below the tag
If your question is primarily about a topic for which you can't find a tag:
- combine multiple words into single-words with hyphens (e.g. stack-overflow), up to a maximum of 35 characters
- creating new tags is a privilege; if you can't yet create a tag you need, then post this question without it, then ask the community to create it for you