Empty line is inserted between every lines when I paste text into editor

I’m finish editing markdown in my VSCode and paste it to the topic editor.
Then empty line is inserted between every lines.

It is annoying that my unordered lists and reference blocks broke into multi parts.

I have searched the forum and didn’t find the same problem.
Any workaround?

1 Like

I’m just confirming the issue with a video example:

1 Like

Hello,

I think the problem is that the copied text is formatted.
I found here a solution: Copy-paste code from Visual Studio, but paste UNFORMATTED code - Stack Overflow

Go to Settings > Search for editor.copyWithSyntaxHighlighting and turn off. This is worked for me. :slightly_smiling_face:

4 Likes

I suspect the editor is picking up a text/html version and pasting that.

Does it function properly if you force a plain text paste?

3 Likes

I tried and it works. :slight_smile: :+1:

Ctrl+Shift+v for the plain text paste shortcut (some don’t know!).

3 Likes

That’d be it then. vscode offers the following formats:

TIMESTAMP,TARGETS,SAVE_TARGETS,MULTIPLE,STRING,UTF8_STRING,TEXT,chromium/x-web-custom-data,text/html,text/plain,text/plain;charset=utf-8

and the text/plain is (for example):

'use std::collections::HashSet;\nuse std::collections::HashMap;\nuse std::io::BufRead;\nuse std::fmt;\n'

whereas the text/html is:

b'<div style="color: #d4d4d4;background-color: #1e1e1e;font-family: \'Droid Sans Mono\', \'monospace\', monospace;font-weight: normal;font-size: 14px;line-height: 19px;white-space: pre;"><div><span style="color: #569cd6;">use</span><span style="color: #d4d4d4;"> std</span><span style="color: #d4d4d4;">::</span><span style="color: #d4d4d4;">collections</span><span style="color: #d4d4d4;">::</span><span style="color: #d4d4d4;">HashSet;</span></div><div><span style="color: #569cd6;">use</span><span style="color: #d4d4d4;"> std</span><span style="color: #d4d4d4;">::</span><span style="color: #d4d4d4;">collections</span><span style="color: #d4d4d4;">::</span><span style="color: #d4d4d4;">HashMap;</span></div><div><span style="color: #569cd6;">use</span><span style="color: #d4d4d4;"> std</span><span style="color: #d4d4d4;">::</span><span style="color: #d4d4d4;">io</span><span style="color: #d4d4d4;">::</span><span style="color: #d4d4d4;">BufRead;</span></div><div><span style="color: #569cd6;">use</span><span style="color: #d4d4d4;"> std</span><span style="color: #d4d4d4;">::</span><span style="color: #d4d4d4;">fmt;</span></div><br></div>'
4 Likes

Thanks to all of you
Didn’t expected for such rapid solution

2 Likes

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.