SOLVED

Why does Teams always strip indentation when pasting text?

%3CLINGO-SUB%20id%3D%22lingo-sub-2349812%22%20slang%3D%22en-US%22%3EWhy%20does%20Teams%20always%20strip%20indentation%20when%20pasting%20text%3F%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2349812%22%20slang%3D%22en-US%22%3E%3CP%3EIt's%20fairly%20common%20to%20want%20to%20post%20code%20in%20teams%20(without%20using%20the%20special%20formatting%20for%20code%20snippets).%3CBR%20%2F%3E%3CBR%20%2F%3EThe%20markdown%20like%20syntax%20for%20code%20works%20pretty%20well%20when%20typing%20code%20and%20it%20preserves%20indentation.%20But%20when%20you%20past%20XML%20or%20JSON%20all%20the%20indentation%20is%20removed.%20Why%3F%3CBR%20%2F%3E%3CBR%20%2F%3EHere's%20an%20example%3A%3CBR%20%2F%3E%3CBR%20%2F%3E%3C%2FP%3E%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22my-kl_0-1620853640676.png%22%20style%3D%22width%3A%20400px%3B%22%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%22my-kl_0-1620853640676.png%22%20style%3D%22width%3A%20400px%3B%22%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%22my-kl_0-1620853640676.png%22%20style%3D%22width%3A%20400px%3B%22%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%22my-kl_0-1620853640676.png%22%20style%3D%22width%3A%20400px%3B%22%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%22my-kl_0-1620853640676.png%22%20style%3D%22width%3A%20400px%3B%22%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%22my-kl_0-1620853640676.png%22%20style%3D%22width%3A%20400px%3B%22%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%22my-kl_0-1620853640676.png%22%20style%3D%22width%3A%20400px%3B%22%3E%3Cspan%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%22my-kl_0-1620853640676.png%22%20style%3D%22width%3A%20400px%3B%22%3E%3Cimg%20src%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F280348iA5C8917E5FB6D15B%2Fimage-size%2Fmedium%3Fv%3Dv2%26amp%3Bpx%3D400%22%20role%3D%22button%22%20title%3D%22my-kl_0-1620853640676.png%22%20alt%3D%22my-kl_0-1620853640676.png%22%20%2F%3E%3C%2Fspan%3E%3C%2FSPAN%3E%3C%2FSPAN%3E%3C%2FSPAN%3E%3C%2FSPAN%3E%3C%2FSPAN%3E%3C%2FSPAN%3E%3C%2FSPAN%3E%3CBR%20%2F%3EThat%20XML%20was%20indented%20in%20the%20source.%20But%20whenever%20we%20paste%20JSON%20or%20XML%20we%20lose%20indentation.%20Unless%20we%20take%20the%20extra%20effort%20to%20use%20a%20code%20snippet.%20Or%20manually%20type%20it%20for%20small%20examples.%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-LABS%20id%3D%22lingo-labs-2349812%22%20slang%3D%22en-US%22%3E%3CLINGO-LABEL%3EUser%20Interface%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2355254%22%20slang%3D%22en-US%22%3ERe%3A%20Why%20does%20Teams%20always%20strip%20indentation%20when%20pasting%20text%3F%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2355254%22%20slang%3D%22en-US%22%3EThis%20is%20on%20macOS%2C%20colleagues%20tell%20me%20they%20don't%20have%20an%20issue%20on%20Windows.%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2355339%22%20slang%3D%22en-US%22%3ERe%3A%20Why%20does%20Teams%20always%20strip%20indentation%20when%20pasting%20text%3F%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2355339%22%20slang%3D%22en-US%22%3EUsing%20this%20website%20I%20was%20able%20to%20examine%20the%20clipboard%20data%20from%20TextEdit%20and%20Visual%20Studio%20code.%3CBR%20%2F%3E%3CBR%20%2F%3EThe%20text%2Fplain%20entries%20look%20identical%2C%20but%20the%20text%2Fhtml%20entries%20are%20radically%20different.%20That%20seems%20to%20be%20a%20clue.%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2355845%22%20slang%3D%22en-US%22%3ERe%3A%20Why%20does%20Teams%20always%20strip%20indentation%20when%20pasting%20text%3F%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2355845%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F1052455%22%20target%3D%22_blank%22%3E%40my-kl%3C%2FA%3E%26nbsp%3B%3CBR%20%2F%3E%3CBR%20%2F%3ESo%20I%20got%20to%20the%20heart%20of%20the%20matter.%20I%20used%20the%26nbsp%3B%3CA%20href%3D%22https%3A%2F%2Fevercoder.github.io%2Fclipboard-inspector%2F%22%20target%3D%22_self%22%20rel%3D%22nofollow%20noopener%20noreferrer%22%3EClipboard%20Inspector%3C%2FA%3E%26nbsp%3Bto%20inspect%20the%20contents%20of%20clipboard%20when%20copying%20the%20same%20text%20from%20two%20different%20apps.%20Both%20have%20two%20entries.%20One%20of%20the%20entries%20is%20text%2Fhtml%20and%20one%20is%20text%2Fplain.%20The%20text%2Fplain%20as%20you%20might%20guess%20is%20identical.%20The%20html%20is%20quite%20different.%20I%20then%20copied%20the%20html%20and%20rendered.%3CBR%20%2F%3E%3CBR%20%2F%3EThis%20is%20what%20I%20see%20from%20TextEdit%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22my-kl_1-1621015953588.png%22%20style%3D%22width%3A%20400px%3B%22%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%22my-kl_1-1621015953588.png%22%20style%3D%22width%3A%20400px%3B%22%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%22my-kl_1-1621015953588.png%22%20style%3D%22width%3A%20400px%3B%22%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%22my-kl_1-1621015953588.png%22%20style%3D%22width%3A%20400px%3B%22%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%22my-kl_1-1621015953588.png%22%20style%3D%22width%3A%20400px%3B%22%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%22my-kl_1-1621015953588.png%22%20style%3D%22width%3A%20400px%3B%22%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%22my-kl_1-1621015953588.png%22%20style%3D%22width%3A%20400px%3B%22%3E%3Cspan%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%22my-kl_1-1621015953588.png%22%20style%3D%22width%3A%20400px%3B%22%3E%3Cimg%20src%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F280778iF619AD2C585A6D42%2Fimage-size%2Fmedium%3Fv%3Dv2%26amp%3Bpx%3D400%22%20role%3D%22button%22%20title%3D%22my-kl_1-1621015953588.png%22%20alt%3D%22my-kl_1-1621015953588.png%22%20%2F%3E%3C%2Fspan%3E%3C%2FSPAN%3E%3C%2FSPAN%3E%3C%2FSPAN%3E%3C%2FSPAN%3E%3C%2FSPAN%3E%3C%2FSPAN%3E%3C%2FSPAN%3E%3C%2FP%3E%3CP%3EThis%20is%20what%20I%20see%20from%20Visual%20Studio%20Code%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22my-kl_0-1621015929280.png%22%20style%3D%22width%3A%20400px%3B%22%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%22my-kl_0-1621015929280.png%22%20style%3D%22width%3A%20400px%3B%22%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%22my-kl_0-1621015929280.png%22%20style%3D%22width%3A%20400px%3B%22%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%22my-kl_0-1621015929280.png%22%20style%3D%22width%3A%20400px%3B%22%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%22my-kl_0-1621015929280.png%22%20style%3D%22width%3A%20400px%3B%22%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%22my-kl_0-1621015929280.png%22%20style%3D%22width%3A%20400px%3B%22%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%22my-kl_0-1621015929280.png%22%20style%3D%22width%3A%20400px%3B%22%3E%3Cspan%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%22my-kl_0-1621015929280.png%22%20style%3D%22width%3A%20400px%3B%22%3E%3Cimg%20src%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F280776i6FF603C2E15BE1CE%2Fimage-size%2Fmedium%3Fv%3Dv2%26amp%3Bpx%3D400%22%20role%3D%22button%22%20title%3D%22my-kl_0-1621015929280.png%22%20alt%3D%22my-kl_0-1621015929280.png%22%20%2F%3E%3C%2Fspan%3E%3C%2FSPAN%3E%3C%2FSPAN%3E%3C%2FSPAN%3E%3C%2FSPAN%3E%3C%2FSPAN%3E%3C%2FSPAN%3E%3C%2FSPAN%3E%3C%2FP%3E%3CP%3ESo%20this%20would%20appear%20to%20be%20an%20issue%20with%20my%20environment%20in%20Visual%20Studio%20Code%20(or%20even%20a%20defect%20in%20Code%2C%20I%22m%20not%20sure)%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2358846%22%20slang%3D%22en-US%22%3ERe%3A%20Why%20does%20Teams%20always%20strip%20indentation%20when%20pasting%20text%3F%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2358846%22%20slang%3D%22en-US%22%3EThis%20can%20probably%20be%20closed.%20I've%20added%20details%20to%20an%20already%20opened%20issue%20on%20GitHub%3A%20%3CA%20href%3D%22https%3A%2F%2Fgithub.com%2Fmicrosoft%2Fvscode%2Fissues%2F122050%23issuecomment-841814182%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noreferrer%22%3Ehttps%3A%2F%2Fgithub.com%2Fmicrosoft%2Fvscode%2Fissues%2F122050%23issuecomment-841814182%3C%2FA%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2846199%22%20slang%3D%22en-US%22%3ERe%3A%20Why%20does%20Teams%20always%20strip%20indentation%20when%20pasting%20text%3F%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2846199%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F1052455%22%20target%3D%22_blank%22%3E%40my-kl%3C%2FA%3E%26nbsp%3BThis%20definitely%20should%20not%20be%20closed%2C%20I%20do%20not%20use%20vscode%20and%20I%20still%20have%20the%20following%20issues%20on%20OSX%5CMSTeams%3A%3CBR%20%2F%3E%3CBR%20%2F%3E1.%20no%20markdown%20support%20(some%20garbage%20WYSIWYG%20constantly%20interfering%20with%20my%20typing).%3CBR%20%2F%3E2.%20%60%60%60%20no%20longer%20creates%20code%20blocks%2090%25%20of%20the%20time.%20In%20fact%2C%20the%20closing%20%60%60%60%20becomes%20a%20weird%20empty%20code%20block%20more%20often%20than%20the%20opening%20code%20block%20ever%20works.%3CBR%20%2F%3E3.%20pretty%20much%20everything%20I%20paste%20into%20MSTeams%20has%20it's%20formatting%20removed%2C%20so%20nobody%20can%20read%20it.%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2846520%22%20slang%3D%22en-US%22%3ERe%3A%20Why%20does%20Teams%20always%20strip%20indentation%20when%20pasting%20text%3F%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2846520%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F1185600%22%20target%3D%22_blank%22%3E%40michaelfs%3C%2FA%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CBLOCKQUOTE%3E3.%20pretty%20much%20everything%20I%20paste%20into%20MSTeams%20has%20it's%20formatting%20removed%2C%20so%20nobody%20can%20read%20it.%3CHR%20%2F%3E%3C%2FBLOCKQUOTE%3E%3CP%3EGood%20to%20know.%20Could%20you%20list%20some%20of%20the%20programs%20you've%20tested%20with.%20As%20I've%20learned%2C%20I%20can%20copy%20from%20TextEdit%20into%20Teams%20without%20issue.%20So%20my%20work%20around%20is%20copy%2Fpaste%20from%20VS%20Code%20into%20TextEdit%20and%20then%20copy%2Fpaste%20from%20there%20into%20Teams.%20With%20respect%20to%20VS%20Code%20it%20seems%20to%20be%20a%20VS%20Code%20issue.%20I%20also%20can%20copy%2Fpaste%20from%20Visual%20Studio%20without%20problem.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EWhat%20programs%20are%20you%20having%20trouble%20with.%20I'd%20be%20interested%20in%20trying%20to%20reproduce.%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2846529%22%20slang%3D%22en-US%22%3ERe%3A%20Why%20does%20Teams%20always%20strip%20indentation%20when%20pasting%20text%3F%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2846529%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F1185600%22%20target%3D%22_blank%22%3E%40michaelfs%3C%2FA%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CBLOCKQUOTE%3E%3CHR%20%2F%3E1.%20no%20markdown%20support%20(some%20garbage%20WYSIWYG%20constantly%20interfering%20with%20my%20typing).%3CBR%20%2F%3E2.%20%60%60%60%20no%20longer%20creates%20code%20blocks%2090%25%20of%20the%20time.%20In%20fact%2C%20the%20closing%20%60%60%60%20becomes%20a%20weird%20empty%20code%20block%20more%20often%20than%20the%20opening%20code%20block%20ever%20works.%3CBR%20%2F%3E%3CBR%20%2F%3E%3CHR%20%2F%3E%3C%2FBLOCKQUOTE%3E%3CP%3ESeems%20like%20a%20different%20issue.%20I%20have%20found%20that%20markdown%20for%20code%20blocks%20doesn't%20work%20for%20me%20in%20%22Chat%22%20but%20works%20just%20fine%20in%20%22Channels%22.%20I%20would%20have%20expected%20it%20to%20work%20everywhere.%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2846605%22%20slang%3D%22en-US%22%3ERe%3A%20Why%20does%20Teams%20always%20strip%20indentation%20when%20pasting%20text%3F%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2846605%22%20slang%3D%22en-US%22%3EYop%2C%3CBR%20%2F%3EI%20had%20the%20habit%20of%20pasting%20using%20CTRL%2BSHIFT%2Bv%20inside%20a%20monospaced%20block%20created%20with%20triple%20backquotes.%3CBR%20%2F%3EIndent%20was%20OK.%3CBR%20%2F%3ESince%20few%20weeks%2C%20it%20doesn't%20work%20anymore.%3CBR%20%2F%3EIndent%20is%20lost.%3CBR%20%2F%3ENot%20sure%20why%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2846608%22%20slang%3D%22en-US%22%3ERe%3A%20Why%20does%20Teams%20always%20strip%20indentation%20when%20pasting%20text%3F%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2846608%22%20slang%3D%22en-US%22%3EYou're%20right.%3CBR%20%2F%3EI%20didn't%20pay%20attention.%3CBR%20%2F%3EIt%20only%20works%20now%20on%20channels%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2846877%22%20slang%3D%22en-US%22%3ERe%3A%20Why%20does%20Teams%20always%20strip%20indentation%20when%20pasting%20text%3F%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2846877%22%20slang%3D%22en-US%22%3EAnother%20thing%20which%20doesn't%20work%20too%20on%20chats%3A%20CTRL%2BA%20to%20select%20all%20when%20you%20write%20a%20message.%3CBR%20%2F%3EIt%20worked%20by%20the%20past.%3CBR%20%2F%3ENow%2C%20it%20only%20works%20on%20channels'%20conversations%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2847779%22%20slang%3D%22en-US%22%3ERe%3A%20Why%20does%20Teams%20always%20strip%20indentation%20when%20pasting%20text%3F%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2847779%22%20slang%3D%22en-US%22%3EYes%20-%20definitely%20still%20an%20issue.%20A%20couple%20of%20weeks%20ago%2C%20the%20regular%20%60%60%60%20stopped%20switching%20immediately%20to%20a%20code%20box.%20Now%20it%20requires%20a%20space%20after%20it%2C%20and%20then%20it%20does%20not%20retain%20formatting.%20As%20noted%20elsewhere%2C%20this%20is%20only%20broken%20in%20Chats.%20The%20original%20(functional)%20behavior%20is%20still%20present%20in%20channels.%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2847832%22%20slang%3D%22en-US%22%3ERe%3A%20Why%20does%20Teams%20always%20strip%20indentation%20when%20pasting%20text%3F%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2847832%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F1185979%22%20target%3D%22_blank%22%3E%40pedorro%3C%2FA%3E%26nbsp%3BThanks%20for%20that%20tip.%20I%20didn't%20realize%20you%20could%20force%20code%20blocks%20by%20typing%20a%20space%20after%20%60%60%60%20.%20I've%20resorted%20to%20using%20quote%20mode%20for%20code.%20This%20is%20nice%20to%20know.%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2848962%22%20slang%3D%22en-US%22%3ERe%3A%20Why%20does%20Teams%20always%20strip%20indentation%20when%20pasting%20text%3F%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2848962%22%20slang%3D%22en-US%22%3EAs%20mentioned%20by%20a%20colleague%2C%20it's%20probably%20related%20to%20the%20following%20new%20functionality%3A%3CBR%20%2F%3E-%20Respond%20to%20a%20specific%20message%20in%20chat%20whith%20quoted%20replies%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2859957%22%20slang%3D%22en-US%22%3ERe%3A%20Why%20does%20Teams%20always%20strip%20indentation%20when%20pasting%20text%3F%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2859957%22%20slang%3D%22en-US%22%3EI'm%20using%20PyCharm%20and%20have%20the%20same%20problem.%3CBR%20%2F%3E%3CBR%20%2F%3EI%20can%20paste%20into%20a%20code%20block%20in%20a%20channel%20just%20fine%2C%20but%20if%20I%20paste%20into%20a%20conversation%20I%20lose%20indenting.%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2860036%22%20slang%3D%22en-US%22%3ERe%3A%20Why%20does%20Teams%20always%20strip%20indentation%20when%20pasting%20text%3F%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2860036%22%20slang%3D%22en-US%22%3EIn%20fact%2C%20it's%20not%20just%20indenting.%3CBR%20%2F%3EMultiple%20spaces%20in%20a%20middle%20of%20a%20string%20are%20replaced%20by%20only%20one.%3CBR%20%2F%3EI%20guess%20it's%20because%20monospaced%20paragraphs%20uses%20html%20formating%20instead%20of%20having%20%22pre%22%20block%20behavior.%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2860317%22%20slang%3D%22en-US%22%3ERe%3A%20Why%20does%20Teams%20always%20strip%20indentation%20when%20pasting%20text%3F%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2860317%22%20slang%3D%22en-US%22%3EFor%20the%20past%20few%20weeks%20I%20have%20this%20problem%20on%20Windows%2010%20and%20VS%20Code%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2868710%22%20slang%3D%22en-US%22%3ERe%3A%20Why%20does%20Teams%20always%20strip%20indentation%20when%20pasting%20text%3F%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2868710%22%20slang%3D%22en-US%22%3E%3CP%3EI%20started%20to%20observe%20the%20issue%20with%20stripped%20spaces%20and%20tabs%20for%20preformatted%20text%20pasted%20may%20be%20month%20ago%20(Windows%2010).%3CBR%20%2F%3EThe%20most%20annoying%20thing%20is%20inserting%20the%20code%20parts%20(even%20from%20Notepad%20or%20Notepad%2B%2B).%3CBR%20%2F%3EIs%20there%20any%20workaround%20for%20this%3F%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2901942%22%20slang%3D%22en-US%22%3ERe%3A%20Why%20does%20Teams%20always%20strip%20indentation%20when%20pasting%20text%3F%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2901942%22%20slang%3D%22en-US%22%3ETurns%20out%20you%20can%20paste%20into%20a%20monospace%20block%20in%20a%20channel%2C%20copy%20the%20text%20back%20out%20and%20then%20paste%20into%20a%20monospace%20block%20in%20a%20chat%20and%20it%20works.%20You%20don't%20need%20to%20actually%20send%20the%20message%20to%20the%20channel.%3CBR%20%2F%3E%3CBR%20%2F%3EIt's%20a%20pain%20but%20it%20works.%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2901944%22%20slang%3D%22en-US%22%3ERe%3A%20Why%20does%20Teams%20always%20strip%20indentation%20when%20pasting%20text%3F%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2901944%22%20slang%3D%22en-US%22%3EI%20tried%20this.%20But%2C%20when%20I%20paste%20from%20TextEdit%20the%20text%20IS%20indented%20...%20but%20the%20line%20breaks%20are%20duplicated.%20I'm%20taking%20a%20similar%20approach%20now%20but%20using%20a%20channel%20message%20as%20the%20intermediary%20rather%20than%20TextEdit.%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2941623%22%20slang%3D%22en-US%22%3ERe%3A%20Why%20does%20Teams%20always%20strip%20indentation%20when%20pasting%20text%3F%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2941623%22%20slang%3D%22en-US%22%3E%3CP%3EI%20had%20issues%20pasting%20from%20vscode%20into%20other%20apps%2C%20including%20teams.%3C%2FP%3E%3CP%3EWorkaround%20for%20me%20is%20disabling%20the%20following%20in%20vscode.%3C%2FP%3E%3CP%3Eeditor.copyWithSyntaxHighlighting%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2941636%22%20slang%3D%22en-US%22%3ERe%3A%20Why%20does%20Teams%20always%20strip%20indentation%20when%20pasting%20text%3F%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2941636%22%20slang%3D%22en-US%22%3E%3CP%3EAnother%20dodgy%20workaround%20for%20when%20you%20need%20to%20show%20indents%20in%20Teams%20from%20a%20block%20of%20text%3A%3C%2FP%3E%3CP%3Epaste%20the%20content%20into%20Microsoft%20Word%2C%20change%20the%20font%20to%20Consolas%2C%20then%20re-copy%20the%20content%20into%20Teams%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2952318%22%20slang%3D%22en-US%22%3ERe%3A%20Why%20does%20Teams%20always%20strip%20indentation%20when%20pasting%20text%3F%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2952318%22%20slang%3D%22en-US%22%3EOddly%20enough%2C%20I%20just%20tried%20this%20and%20still%20have%20the%20formatting%20gone%20when%20I%20paste%20into%20Teams.%20I%20added%20this%20setting%20(set%20to%20false)%20to%20settings.json%2C%20restarted%20VS%20Code%2C%20and%20tried%20it.%20Did%20I%20miss%20a%20step%3F%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2958869%22%20slang%3D%22en-US%22%3ERe%3A%20Why%20does%20Teams%20always%20strip%20indentation%20when%20pasting%20text%3F%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2958869%22%20slang%3D%22en-US%22%3EThe%20fact%20that%20this%20trick%20actually%20works%20makes%20me%20even%20more%20disappointed%20at%20a%20_software_%20company%20like%20Microsoft%20and%20their%20terrible%20coding%20quality...%20How%20can%20they%20have%20so%20many%20features%20that%20only%20work%20on%20a%20specific%20type%20of%20text%20box%3F%20E.g.%20you%20can't%20add%20formatting%20(%22-%22%2C%20%22%26gt%3B%22%2C%20%22%60%60%60%22)%20on%20a%20call's%20chat%20but%20you%20can%20if%20you%20do%20through%20the%20MSTeams%20app%20on%20the%20_same_%20chat%2C%20typing%20a%20parenthesis%20doesn't%20open%20the%20emoji%20popup%20in%20Team%20but%20does%20in%20Chat%2C%20the%20indents%20get%20removed%20when%20pasting%20into%20Chat%20but%20not%20into%20Team...%20Please%20use%20a%20centralized%20library%20for%20text%20editing%20and%20let%20us%20be%20productive!!%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2982619%22%20slang%3D%22en-US%22%3ERe%3A%20Why%20does%20Teams%20always%20strip%20indentation%20when%20pasting%20text%3F%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2982619%22%20slang%3D%22en-US%22%3EI%20came%20here%20looking%20for%20this%20very%20conversion.%20It's%20compressing%20spaces%20everywhere%20now%2C%20even%20in%20ordinary%20chat.%20(Yes%2C%20I%20am%20a%20two-space-after-the-period%20person%20and%20I%20don't%20like%20it%20messed%20with.)%20This%20started%20around%20November%201.%20I%20don't%20see%20anything%20in%20the%20release%20notes%20about%20the%20change%20in%20behavior.%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-3002759%22%20slang%3D%22en-US%22%3ERe%3A%20Why%20does%20Teams%20always%20strip%20indentation%20when%20pasting%20text%3F%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-3002759%22%20slang%3D%22en-US%22%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F41501%22%20target%3D%22_blank%22%3E%40microsoft%3C%2FA%3E%20-%20were%20you%20going%20to%20fix%20this%3F%20Should%20we%20move%20back%20to%20slack%3F%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-3015029%22%20slang%3D%22en-US%22%3ERe%3A%20Why%20does%20Teams%20always%20strip%20indentation%20when%20pasting%20text%3F%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-3015029%22%20slang%3D%22en-US%22%3EI'm%20the%20OP.%20My%20guess%20is%20this%20is%20not%20the%20correct%20place%20for%20bug%20reports.%20I'm%20not%20sure%20what%20the%20correct%20forum%20to%20report%20bugs%20for%20Teams%20is.%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-3015054%22%20slang%3D%22en-US%22%3ERe%3A%20Why%20does%20Teams%20always%20strip%20indentation%20when%20pasting%20text%3F%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-3015054%22%20slang%3D%22en-US%22%3E%3CP%3EMS%20has%20been%20ignoring%20our%20bug%20reports%20for%20months%20at%20this%20point.%20I%20have%20no%20idea%20why%20my%20company%20switched%20to%20this%20garbage%20pile.%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-3031836%22%20slang%3D%22en-US%22%3ERe%3A%20Why%20does%20Teams%20always%20strip%20indentation%20when%20pasting%20text%3F%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-3031836%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F1052455%22%20target%3D%22_blank%22%3E%40my-kl%3C%2FA%3E%26nbsp%3BThere%20is%20a%20way%20to%20paste%20into%20a%20Teams%20chat%20and%20have%20indentation%20preserved.%26nbsp%3B%3CBR%20%2F%3E%3CBR%20%2F%3EFirst%20click%20on%20the%20%22Format%22%20icon%26nbsp%3B%3CBR%20%2F%3E%3CBR%20%2F%3E%3C%2FP%3E%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22dandante_0-1638816672814.png%22%20style%3D%22width%3A%20400px%3B%22%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%22dandante_0-1638816672814.png%22%20style%3D%22width%3A%2082px%3B%22%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%22dandante_0-1638816672814.png%22%20style%3D%22width%3A%2082px%3B%22%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%22dandante_0-1638816672814.png%22%20style%3D%22width%3A%2082px%3B%22%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%22dandante_0-1638816672814.png%22%20style%3D%22width%3A%2082px%3B%22%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%22dandante_0-1638816672814.png%22%20style%3D%22width%3A%2082px%3B%22%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%22dandante_0-1638816672814.png%22%20style%3D%22width%3A%2082px%3B%22%3E%3Cspan%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%22dandante_0-1638816672814.png%22%20style%3D%22width%3A%2082px%3B%22%3E%3Cimg%20src%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F331986i0635B73ACD27E977%2Fimage-size%2Fmedium%3Fv%3Dv2%26amp%3Bpx%3D400%22%20role%3D%22button%22%20title%3D%22dandante_0-1638816672814.png%22%20alt%3D%22dandante_0-1638816672814.png%22%20%2F%3E%3C%2Fspan%3E%3C%2FSPAN%3E%3C%2FSPAN%3E%3C%2FSPAN%3E%3C%2FSPAN%3E%3C%2FSPAN%3E%3C%2FSPAN%3E%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%3CBR%20%2F%3EThen%20click%20on%20the%20%22Code%20Snippet%22%20icon%3CBR%20%2F%3E%3CBR%20%2F%3E%3CBR%20%2F%3E%3C%2FP%3E%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22dandante_1-1638816718026.png%22%20style%3D%22width%3A%20400px%3B%22%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%22dandante_1-1638816718026.png%22%20style%3D%22width%3A%2082px%3B%22%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%22dandante_1-1638816718026.png%22%20style%3D%22width%3A%2082px%3B%22%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%22dandante_1-1638816718026.png%22%20style%3D%22width%3A%2082px%3B%22%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%22dandante_1-1638816718026.png%22%20style%3D%22width%3A%2082px%3B%22%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%22dandante_1-1638816718026.png%22%20style%3D%22width%3A%2082px%3B%22%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%22dandante_1-1638816718026.png%22%20style%3D%22width%3A%2082px%3B%22%3E%3Cspan%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%22dandante_1-1638816718026.png%22%20style%3D%22width%3A%2082px%3B%22%3E%3Cimg%20src%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F331988i97B9F6BAD2C628F5%2Fimage-size%2Fmedium%3Fv%3Dv2%26amp%3Bpx%3D400%22%20role%3D%22button%22%20title%3D%22dandante_1-1638816718026.png%22%20alt%3D%22dandante_1-1638816718026.png%22%20%2F%3E%3C%2Fspan%3E%3C%2FSPAN%3E%3C%2FSPAN%3E%3C%2FSPAN%3E%3C%2FSPAN%3E%3C%2FSPAN%3E%3C%2FSPAN%3E%3C%2FSPAN%3E%3C%2FP%3E%3CP%3EInside%20a%20code%20snippet%20you%20can%20paste%20code%20and%20indentation%20is%20preserved.%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-3031861%22%20slang%3D%22en-US%22%3ERe%3A%20Why%20does%20Teams%20always%20strip%20indentation%20when%20pasting%20text%3F%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-3031861%22%20slang%3D%22en-US%22%3EYes%2C%20I%20made%20note%20of%20that%20in%20my%20original%20post%3A%3CBR%20%2F%3E%3CBR%20%2F%3E%26gt%3B%20Unless%20we%20take%20the%20extra%20effort%20to%20use%20a%20code%20snippet.%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-3031863%22%20slang%3D%22en-US%22%3ERe%3A%20Why%20does%20Teams%20always%20strip%20indentation%20when%20pasting%20text%3F%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-3031863%22%20slang%3D%22en-US%22%3EWhoops%2C%20missed%20that.%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-3048190%22%20slang%3D%22en-US%22%3ERe%3A%20Why%20does%20Teams%20always%20strip%20indentation%20when%20pasting%20text%3F%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-3048190%22%20slang%3D%22en-US%22%3E%3CP%3Esame%20issue%20when%20not%20pasting%2C%20but%20just%20typing...%20trying%20to%20write%20up%20pseudo-code%20to%20colleagues%20while%20explaining%20a%20concept%2C%20and%20all%20indentation%2C%20leading%20white%20space%20is%20stripped.%20Quite%20frustrating.%20I%20know%20we%20can%20spend%20the%20extra%20time%20to%20create%20a%20little%20code%20snippet%20tool%2C%20but%20when%20writing%20back%20and%20forth%20to%20colleagues%20on%20code%20design%20and%20concept%2C%20it%20just%20isn't%20practical%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-3056469%22%20slang%3D%22en-US%22%3ERe%3A%20Why%20does%20Teams%20always%20strip%20indentation%20when%20pasting%20text%3F%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-3056469%22%20slang%3D%22en-US%22%3E%3CP%3EYeah...%20Teams%20is%20total%20garbage.%26nbsp%3B%20Let's%20not%20make%20excuses%20for%20Microsoft%20by%20saying%20the%20problem%20has%20a%20workaround.%26nbsp%3B%20This%20is%20the%20most%20basic%20stuff%20there%20is.%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EIf%20you%20copy%20plain%20text%20to%20your%20clipboard%2C%20you%20%3CSTRONG%3Eshould%3C%2FSTRONG%3E%20be%20able%20to%20paste%20it%20into%20Teams%20without%20having%20it%20strip%20leading%20spaces.%26nbsp%3B%20Copying%20from%20most%20applications%20will%20put%20plaint%20text%20%3CEM%3Eas%20well%20as%3C%2FEM%3E%20a%20few%20different%20forms%20of%20formatted%20text%20(rich-text%2C%20html).%26nbsp%3B%20This%20way%2C%20if%20you%20are%20pasting%20to%20an%20application%20that%20understands%20those%20formats%2C%20you%20can%20keep%20all%20the%20extra%20colors%2Ffonts%2Ftables%2Fetc.%26nbsp%3B%20Many%20applications%20even%20give%20you%20this%20control%20when%20you%20paste%2C%20by%20having%20another%20option%20under%20the%20Edit%20menu%20that%20explicitly%20says%2C%20%22Paste%20in%20plain%20text%22.%26nbsp%3B%20The%20equivalent%20(you'd%20think)%20in%20Teams%20says%20%22Paste%20and%20Match%20Style%22%2C%20except%2C%20it%20still%20strips%20your%20spaces.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EI%20noticed%20recently%20that%20when%20I'm%20typing%20a%20message%20in%20Teams%2C%20typing%20cmd-a%20(the%20equivalent%20of%20ctrl-a%20on%20Windows)%2C%20that%20shortcut%20seems%20to%20be%20completely%20ignored.%26nbsp%3B%20I%20can%20click%20Edit%20%26gt%3B%20Select%20All...%20but%20I%20don't%20want%20to%20touch%20the%20mouse%20for%20a%20shortcut%20that%20Microsoft%20invented...%20it's%20been%20around%20since%20at%20least%20Windows%203.0.%26nbsp%3B%20How%20is%20it%20that%20they%20keep%20managing%20to%20bugger%20up%20TYPING%20in%20Teams%3F!%3F%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-3056478%22%20slang%3D%22en-US%22%3ERe%3A%20Why%20does%20Teams%20always%20strip%20indentation%20when%20pasting%20text%3F%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-3056478%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F151314%22%20target%3D%22_blank%22%3E%40Nshaw%3C%2FA%3E%26nbsp%3Bfunny%20you%20say%20that%2C%20I%20(on%20a%20Windows%20machine%2C%20therefore%20using%20ctrl%20%2B%20a)%20also%20have%20the%20same%20issue%20lately%2C%20it's%20like%20they%20completely%20removed%20keyboard%20shortcuts.%3CBR%20%2F%3EThere%20are%20many%20times%20I%20am%20typing%20a%20response%20and%20the%20conversation%20goes%20a%20different%20direction%20while%20I%20type%20and%20therefore%20need%20to%20trash%20what%20I%20was%20writing%2C%20going%20to%20try%20ctrl%20%2B%20a%20and%20rewrite%20a%20new%20message%2C%20I%20now%20need%20to%20use%20my%20mouse%20just%20to%20delete%20the%20current%20text...%20frustrating!%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-3056480%22%20slang%3D%22en-US%22%3ERe%3A%20Why%20does%20Teams%20always%20strip%20indentation%20when%20pasting%20text%3F%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-3056480%22%20slang%3D%22en-US%22%3EYeah%2C%20my%20normal%20use-case%20is%20that%20I'll%20hit%20ctrl%2Ba%2C%20ctrl-x%2C%20then%20respond%20to%20something%20really%20quickly%2C%20then%20hit%20ctrl-v%20to%20get%20back%20to%20my%20monologue.%20%3B)%3C%2Fimg%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-3058399%22%20slang%3D%22en-US%22%3ERe%3A%20Why%20does%20Teams%20always%20strip%20indentation%20when%20pasting%20text%3F%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-3058399%22%20slang%3D%22en-US%22%3EThis%20happens%20with%20purely%20%60text%2Fplain%60%20clipboard%20content%2C%20e.g.%20when%20copying%20from%20Notepad%2B%2B%2C%20so%20this%20definitely%20is%20a%20bug%20in%20Teams%20not%20any%20specific%20source%20application.%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-3058885%22%20slang%3D%22en-US%22%3ERe%3A%20Why%20does%20Teams%20always%20strip%20indentation%20when%20pasting%20text%3F%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-3058885%22%20slang%3D%22en-US%22%3E%3CP%3EThis%20needs%20fixing%20ASAP.%20It's%20absolutely%20ridiculous%20not%20to%20be%20able%20to%20paste%20code%20in%20a%20chat%20app%20and%20have%20it%20strip%20out%20whitespace.%3CBR%20%2F%3EIt's%20not%20even%20whitespace%20at%20the%20start%20of%20lines%2C%20it%20strips%20out%20consecutive%20whitespace%20within%20pasted%20text%20too.%20Spaces%2C%20tabs%2C%20anything.%3C%2FP%3E%3CP%3EI%20work%20in%20a%20team%20of%20software%20developers%2C%20it's%20outrageous%20such%20a%20simple%20thing%20doesn't%20work.%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-3058898%22%20slang%3D%22en-US%22%3ERe%3A%20Why%20does%20Teams%20always%20strip%20indentation%20when%20pasting%20text%3F%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-3058898%22%20slang%3D%22en-US%22%3E...and%20the%20code%20snippet%20is%20not%20a%20substitute.%20It%20only%20displays%20five%20lines%20without%20expanding%2C%20and%20the%20entry%20is%20through%20a%20thought-interrupting%20popup.%20The%20%22Monospaced%22%20formatting%20was%20just%20fine%20for%20medium%20length%20pastes.%20(Actually%2C%20what%20is%20the%20point%20of%20monospaced%20formatting%20when%20the%20whitespace%20is%20collapsed%3F%20When%20is%20it%20even%20useful%3F)%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-3072844%22%20slang%3D%22en-US%22%3ERe%3A%20Why%20does%20Teams%20always%20strip%20indentation%20when%20pasting%20text%3F%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-3072844%22%20slang%3D%22en-US%22%3EAlso%20works%20via%20a%20new%20mail%20in%20Outlook%20and%20setting%20to%20consolas%3CBR%20%2F%3E(I%20work%20w%2F%20Outlook%20more%20than%20Word%2C%20so%20it's%20already%20open)%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-3140077%22%20slang%3D%22en-US%22%3ERe%3A%20Why%20does%20Teams%20always%20strip%20indentation%20when%20pasting%20text%3F%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-3140077%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F1223309%22%20target%3D%22_blank%22%3E%40dbomp%3C%2FA%3E%26nbsp%3BAgreed%20code%20snippet%20is%20not%20a%20workaround.%26nbsp%3B%20Not%20only%20for%20the%20reasons%20you%20stated%2C%20but%20also%20because%20you%20can't%20apply%20any%20other%20text%20formatting%20to%20the%20code%20snippet.%26nbsp%3B%20One%20thing%20I%20do%20quite%20a%20bit%20(or%20used%20to)%20is%20paste%20a%20bit%20of%20code%2C%20then%20highlight%20the%20part%20I%20want%20to%20draw%20attention%20to.%26nbsp%3B%20This%20woks%20in%20a%20Monospaced%20paragraph%20(but%20now%20the%20spaces%20are%20stripped%20so%20that's%20now%20useless).%3C%2FP%3E%3C%2FLINGO-BODY%3E
Occasional Contributor

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:

my-kl_0-1620853640676.png
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.

50 Replies
This is on macOS, colleagues tell me they don't have an issue on Windows.
Ok some more sleuthing:

If I copy from Visual Studio Code and paste into Teams (on macOS) this problem happens.

If I copy from TextEdit or Visual Studio and paste into Teams, the indentation is fine.

So this is weird interaction between Teams, the clipboard and Visual Studio Code.

But, I can copy from Visual Studio Code into TextEdit and everything is fine. Then I can copy from TextEdit and paste into Teams and everything is fine.

Anyone have a firm understanding of how the clipboard works and what app might be working incorrectly? Seems perhaps Teams is confused by meta data from Visual Studio Code?
Using this website I was able to examine the clipboard data from TextEdit and Visual Studio code.

The text/plain entries look identical, but the text/html entries are radically different. That seems to be a clue.
best response confirmed by ThereseSolimeno (Microsoft)
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

 

my-kl_1-1621015953588.png

This is what I see from Visual Studio Code

 

my-kl_0-1621015929280.png

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)

 

This can probably be closed. I've added details to an already opened issue on GitHub: https://github.com/microsoft/vscode/issues/122050#issuecomment-841814182

@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.

@michaelfs 

 

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.

@michaelfs 

 


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.

Yop,
I had the habit of pasting using CTRL+SHIFT+v inside a monospaced block created with triple backquotes.
Indent was OK.
Since few weeks, it doesn't work anymore.
Indent is lost.
Not sure why
You're right.
I didn't pay attention.
It only works now on channels
Another thing which doesn't work too on chats: CTRL+A to select all when you write a message.
It worked by the past.
Now, it only works on channels' conversations
Yes - definitely still an issue. A couple of weeks ago, the regular ``` stopped switching immediately to a code box. Now it requires a space after it, and then it does not retain formatting. As noted elsewhere, this is only broken in Chats. The original (functional) behavior is still present in channels.

@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.

As mentioned by a colleague, it's probably related to the following new functionality:
- Respond to a specific message in chat whith quoted replies
I'm using PyCharm and have the same problem.

I can paste into a code block in a channel just fine, but if I paste into a conversation I lose indenting.
In fact, it's not just indenting.
Multiple spaces in a middle of a string are replaced by only one.
I guess it's because monospaced paragraphs uses html formating instead of having "pre" block behavior.
For the past few weeks I have this problem on Windows 10 and VS Code

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?

Turns out you can paste into a monospace block in a channel, copy the text back out and then paste into a monospace block in a chat and it works. You don't need to actually send the message to the channel.

It's a pain but it works.