-
Notifications
You must be signed in to change notification settings - Fork 61
Closed
Labels
bugSomething isn't workingSomething isn't working
Description
Describe the bug
The Stacks Editor does not properly render <code> elements and incorrectly escapes them when toggling from Markdown mode to rendered mode.
To Reproduce
- Start a new post. Make sure you are in Markdown mode, not rendered/rich edit mode.
- Enter the following Markdown:
<code>this should be code formatted <i>with some italics inside</i></code>

- Click the toggle to switch to rendered/rich edit mode.
- Click the toggle to switch back to Markdown mode.
Expected behavior
- After step 3, the rendered post looks like:
this should be code formatted with some italics inside - After step 3, the Markdown should be exactly what was entered after step 2
Actual behavior
-
After step 3, the rendered post has literal <code> and </code> shown. None of the sentence has typewriter formatting. The italics are shown correctly:

-
After step 3, the Markdown has had <code> changed to `<code>` and similarly for </code>:
`<code>`this should be code formatted <i>with some italics inside</i>`</code>`
Desktop (please complete the following information):
- OS: Windows 10
- Browser: Firefox 85.0, Edge 88.0.705.56
Additional context
If I submit the answer/edit without previewing, the <code> elements are rendered correctly.
I first encountered this on a StackOverflow Enterprise installation. I have the same experience on Meta Stack Exchange.
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working
