Open sathomas opened 7 years ago
As a point of reference, atom.io does not have this problem, so if it's Electron-releated there is a way to avoid it.
Possibly related https://github.com/Microsoft/vscode/issues/31889
I've been through a similar problem recently. After updating vscode to the 1.42.1 version the code copied from vscode wasn't keeping indentation anywhere (Libreoffice, google docs, WPS Office).
Looking into the problem I saw the html generated by the 1.42.1 version is generating regular spaces instead of non-breaking spaces inside the <span>
tags, it seems that this strategy doesn't play well with the software I mentioned above.
So for now I rolled back to the version 1.39.2 since this is a feature I rely on for generating documentation for my clients.
More details are below:
OS: Ubuntu 19.10 It's reproducible without extexsions
HTML Generated by VS Code 1.39.2
<meta http-equiv="content-type" content="text/html; charset=utf-8"><div style="color: #333333;background-color: #fdf6e3;font-family: '"Jetbrains Mono",Iosevka', 'Droid Sans Mono', 'monospace', monospace, 'Droid Sans Fallback';font-weight: normal;font-size: 14px;line-height: 19px;white-space: pre;"><div><span style="color: #268bd2;">servers</span><span style="color: #333333;">:</span></div><div><span style="color: #333333;"> - </span><span style="color: #268bd2;">description</span><span style="color: #333333;">: </span><span style="color: #2aa198;">Server1</span></div><div><span style="color: #333333;"> </span><span style="color: #268bd2;">url</span><span style="color: #333333;">: </span><span style="color: #2aa198;">http://api.example.com/v1/servers</span></div><br></div>
HTML Generated by VS Code 1.42.1
<meta http-equiv="content-type" content="text/html; charset=utf-8"><div style="color: #333333;background-color: #fdf6e3;font-family: '"Jetbrains Mono",Iosevka', 'Droid Sans Mono', 'monospace', monospace, 'Droid Sans Fallback';font-weight: normal;font-size: 14px;line-height: 19px;white-space: pre;"><div><span style="color: #268bd2;">servers</span><span style="color: #333333;">:</span></div><div><span style="color: #333333;"> - </span><span style="color: #268bd2;">description</span><span style="color: #333333;">: </span><span style="color: #2aa198;">Server1</span></div><div><span style="color: #333333;"> </span><span style="color: #268bd2;">url</span><span style="color: #333333;">: </span><span style="color: #2aa198;">http://api.example.com/v1/servers</span></div><br></div>
[EDIT]
I just saw the change that makes it stop working:
b6138b95268aea0768f77ae8e4eacbcc0621bf07
and it closes the issue
It'd be nice to have this back to work on Ubuntu, but I really don't know how to conciliate both issues.
This might be an Electron problem rather than VS Code, but copying text to the clipboard does not preserve tabs. Instead, it converts the tabs to an appropriate number of non-breaking space characters.
Here is
settings.json
:Steps to Reproduce:
Reproduces without extensions: Yes