Pasted text not preserving line breaks (or similar issue)

Bug

The Paragraph are not in the position they are supposed to be.Paragraph are not pasted correctly in their order. Although the Format option like headings and bold and italic option are working fine.

They

go like this for an example. instead of this line

being continuous with the above line.

To Reproduce

Steps to reproduce the behavior:

    1. Copy content from a webpage
    1. paste it in Anytype
    1. See an error. The Paragraph are not in the position they are supposed to be.

Expected behavior

A clear and concise description of what you expected to happen.

Desktop (please complete the following information):

  • OS: Ubuntu
  • Device: Custom pc
  • Version: 0.18.59
4 Likes

I can’t reproduce this. Can you give an example, like a specific web page where this happens?

@Oshyan The content copied from was a substack website one.

1 Like

@Srinath I face this problem in some websites

1 Like

This happens even whencopied from PDF or DocX.

Still can’t reproduce, even with the same website. So I suspect it may be an OS issue, or if you have some Clipboard utility/setting that is involved perhaps. @Srinath are all these tests on Linux? (your screenshot looks Mac-like, but I think that’s just a theme, eh?).

@Tanzeel098 @Sedulous what platform are you on? Maybe we can find a commonality.

@Oshyan elementary 6 odin with white sur theme for a dark title bar for now, but this should not be a issue. They are tested only in linux.

@Oshyan maybe a linux thing?

@Oshyan Happens the same to me with mac os

@Kite Weird, OK. With that specific website?

I’m only being so particular about all this because the devs will usually need to know exactly how to reproduce it for them to figure out why it happens and solve it. If you can provide more detail/specifics about what you’re doing to replicate it (what source page, the exact text contents you’re copying, whether you’re using any clipboard tools, etc.), that would be great.

@Oshyan I can reproduce it too, haven’t tried other websites but it does in the one linked in the issue.

[Link to the article](The Rich Don't Penny Pinch - by Sean McClure - NonTrivial)

I did not have any special clipboard tools. To reproduce the issue, all i’ve got to do is copy few paragraphs from the page and paste it in an Anytype page. I tried pasting it in a different text editor that comes with the distro and it was fine.

Additional Details:

  • OS: Opensuse Tumbleweed X11 KDE
  • Anytype Version: 0.18.59
2 Likes

@Oshyan OS with default settings with only white sue theme extra. Downloaded the anytype 0.18.59 directly from Website.

1 Like

@Kirill_Lem This happens on android too.

Android 11.

Looks like it is not specific to that particular website. Seems to be happening on several different websites for me

1 Like

I am also experiencing the same issue, on both Android 0.5.0 and Desktop 0.22.3, on MacOS 12.2.

The webpage that this error occurs on is a CNN article (Time is running out for Beijing to prepare its economy for a demographic crisis | CNN Business). There’s more examples; the CNN article is just one out of many that is experiencing the issue. Copying and pasting multiple paragraphs always causes the first word to have another indent.

Curiously, this error seems to happen when pasting into block-based editors - Notion is also affected. Non-block based editors, such as Pages and TextEdit perfectly preserve the line breaks.

Pasting back from a non-block based editor into a block-based one (both Anytype and Notion) also successfully preserves the line breaks.


The top section is copied directly from the aforementioned webpage, while the bottom one was first pasted into Apple Pages, then copied back to Anytype.


Other non-block based editors don’t suffer from the same problem.


Notion also has problems with line breaks. However, pasting without formatting works to preserve normal line break text, although this isn’t ideal.

This appears to not be the only clipboard related issue that is present within the Object Canvas; I’ve also experienced issues copying and pasting images, described in my bug report here.

Just realized - It seems as if the issue, on Mac OS, will only happen when copying from a webpage in Firefox, not in other browsers, such as Chrome or Safari.

Using the Apple-provided tool Clipboard Viewer, the raw HTML (public.html and Apple HTML pasteboard type) can be seen that is in the clipboard.

When copying from Firefox, the clipboard data contains Unicode line breaks, as can be seen with this tool.

The line breaks exactly line up with where Anytype (and Notion) inserted them.

However, with Safari and Chrome, the raw HTML output doesn’t contain any line breaks, and the pasted text in Anytype also doesn’t contain any at the specified locations.

Copying from other browsers doesn’t seem to have fixed my other bug report about this - the image pasting and bold issue still remains.

2 Likes

I’m noticing the reverse pasting issue (From anytype, to other locations) on my end as well. I tend to use anytype as an isolated writing space, and use Grammarly for editing. I’ll use Shift+Enter to create linebreaks within a block, but when I paste, all of these linebreaks are lost.

When using multiple blocks, there are linebreaks, but any blank lines, are missing. Meaning, if I had a blank line between two paragraphs, this gap is missing and the two paragraphs meet each other.

Let me know if this is unclear, or if anyone experiences this as well.

I recognize a related issue when having a blog of text with line breaks in the desktop app, these line breaks disappear in the mobile app. This makes editing difficult because it might corrupt the format.

Desktop app v0.23.5 (Windows):
image

Mobile app v0.5.2-alpha (Android):
image

Thanks a lot.

1 Like

My issue with copying and pasting is that the formatting is incorrect. The content gets pasted, but it seems like it picks up line breaks that don’t exist. Here’s an example of pasting content from an article:


I should also note that this isn’t unique to the source—tried with a handful of different publications, and Anytype is inserting line breaks after the first word in a paragraph as well as some random word (or length) in the string.

Are you using the Firefox browser? I do believe there might be a bug that causes Firefox (Pasted text not preserving line breaks (or similar issue) - #21 by edwards) to inject line breaks to the clipboard. To confirm, can you try again with Chrome?

2 Likes