misbehave icon indicating copy to clipboard operation
misbehave copied to clipboard

No Line Breaks When Pasting

Open mudgen opened this issue 5 years ago • 4 comments

When I paste the contents of code into a misbehave component the resulting code is displayed in single line instead of many lines the code was copied from.

Is there any way to show the line breaks of code that has has been pasted in?

mudgen avatar May 05 '20 15:05 mudgen

@mudgen Sorry for the slow reaction speed! only just saw this.

Hmm, would have to debug a bit, what browser / OS are you using? Any particular snippet to reproduce with? Where are you copying from?

By default, this seems to work for me, if I f.e. am copying in the text I have just written in this box to the demo implementations linked from the README. 🤔

orbitbot avatar May 20 '20 10:05 orbitbot

I have this problem when when I copy code from vs-code and paste it into the demo.

mudgen avatar May 20 '20 17:05 mudgen

Ok, interesting. I have managed to reproduce that case, though for some reason it seems to not be much of an issue if the text snippet is copied elsewhere inbetween. I'll try to get around to it at some point, but unfortunately mental bandwidth for this isn't hugely available, so if you're depending on this don't expect a too much progress in the short term as I don't immediately have an idea of what's going on.

That being said, it might be interesting to check the content of the clipboard before the paste with the clipboard api, or then attach something different as a store instance to see what's getting passed in. There might well be some kind of implementation detail somewhere, but it's kind of curious that I haven't been able to reproduce it with a handful of other apps.

orbitbot avatar May 22 '20 20:05 orbitbot

Yes. @orbitbot Thanks so much for looking into this.

mudgen avatar May 22 '20 21:05 mudgen