May 12 2021 02:09 PM - edited Feb 28 2022 02:20 PM
It's fairly common to want to post code in teams (without using the special formatting for code snippets).
The markdown like syntax for code works pretty well when typing code and it preserves indentation. But when you paste XML or JSON all the indentation is removed. Why?
Here's an example:
That XML was indented in the source. But whenever we paste JSON or XML we lose indentation. Unless we take the extra effort to use a code snippet. Or manually type it for small examples.
May 14 2021 08:40 AM
May 14 2021 08:54 AM
May 14 2021 08:57 AM
May 14 2021 11:14 AM
Solution@my-kl
So I got to the heart of the matter. I used the Clipboard Inspector to inspect the contents of clipboard when copying the same text from two different apps. Both have two entries. One of the entries is text/html and one is text/plain. The text/plain as you might guess is identical. The html is quite different. I then copied the html and rendered.
This is what I see from TextEdit
This is what I see from Visual Studio Code
So this would appear to be an issue with my environment in Visual Studio Code (or even a defect in Code, I"m not sure)
May 16 2021 06:04 AM
Oct 14 2021 07:04 AM
@my-kl This definitely should not be closed, I do not use vscode and I still have the following issues on OSX\MSTeams:
1. no markdown support (some garbage WYSIWYG constantly interfering with my typing).
2. ``` no longer creates code blocks 90% of the time. In fact, the closing ``` becomes a weird empty code block more often than the opening code block ever works.
3. pretty much everything I paste into MSTeams has it's formatting removed, so nobody can read it.
Oct 14 2021 08:39 AM - edited Oct 14 2021 08:40 AM
3. pretty much everything I paste into MSTeams has it's formatting removed, so nobody can read it.
Good to know. Could you list some of the programs you've tested with. As I've learned, I can copy from TextEdit into Teams without issue. So my work around is copy/paste from VS Code into TextEdit and then copy/paste from there into Teams. With respect to VS Code it seems to be a VS Code issue. I also can copy/paste from Visual Studio without problem.
What programs are you having trouble with. I'd be interested in trying to reproduce.
Oct 14 2021 08:41 AM
1. no markdown support (some garbage WYSIWYG constantly interfering with my typing).
2. ``` no longer creates code blocks 90% of the time. In fact, the closing ``` becomes a weird empty code block more often than the opening code block ever works.
Seems like a different issue. I have found that markdown for code blocks doesn't work for me in "Chat" but works just fine in "Channels". I would have expected it to work everywhere.
Oct 14 2021 08:53 AM
Oct 14 2021 08:55 AM
Oct 14 2021 09:36 AM
Oct 14 2021 01:20 PM
Oct 14 2021 01:40 PM
@pedorro Thanks for that tip. I didn't realize you could force code blocks by typing a space after ``` . I've resorted to using quote mode for code. This is nice to know.
Oct 15 2021 12:25 AM
Oct 19 2021 01:48 AM
Oct 19 2021 02:07 AM
Oct 19 2021 03:24 AM
Oct 21 2021 02:48 AM
I started to observe the issue with stripped spaces and tabs for preformatted text pasted may be month ago (Windows 10).
The most annoying thing is inserting the code parts (even from Notepad or Notepad++).
Is there any workaround for this?
Oct 29 2021 12:47 PM