Stacks-Editor
Stacks-Editor copied to clipboard
bug(editor) Text originating from a code editor will be pasted in as code, even if is definitely not code
Describe the bug Any text that is copied from a code editor (including VS, VS Code, and even revisions/source in the browser) is pasted into both MD and RT as a fenced code block. This happens even if the text in question has no markdown at all (though really, the presence of markdown should not cause this).
To Reproduce Steps to reproduce the behavior:
- Go to revisions/source for the MSE post and copy out any text. The 4th paragraph has no markdown.
- Go to the stacks editor, paste it in
- Note: is a fenced code block if pasted into either mode
Expected behavior A clear and concise description of what you expected to happen.
Screenshots
Desktop (please complete the following information): Windows 11 Chrome 103
Additional context https://meta.stackexchange.com/a/380334/51
It's because the originating text is formatted as code, so there's an attempt to preserve that
So you can repro with just an old code snippet regardless of what's in there - if you copy and paste from the following block
my text formatted as code
It'll also insert into the editor as code. That seems reasonable to me if the source formatting was code, independent of trying to smart-parse the content.
In my opinion, if I write a whole markdown article in VS Code, it is text, not code. Even if it came from VS Code. Or view-source
. I am not talking about copying from a pre
(which should be interpreted as code).