okfde / froide

Freedom Of Information Portal
MIT License
366 stars 87 forks source link

Improve support for copying texts from Froide #246

Closed GiantCrocodile closed 6 years ago

GiantCrocodile commented 6 years ago

I noticed that if you try to copy text from a request on FragDenStaat.de that it's not optimal: Any new line gets removed and the whole text is a single paragraph. I dislike this because I have to copy texts from replies sometimes, if I'm going to write a legal caveat.

stefanw commented 6 years ago

Can you give an example of what you're trying to copy and what browser and OS you're using?

jfilter commented 6 years ago

E.g. copying the whole message in order to send a fax: https://fragdenstaat.de/anfrage/verfahrenskosten-zu-wildtierverbot/#nachricht-82556

I have problems on MacOS with Firefox. Works with Chrome/Safari though.

stefanw commented 6 years ago

Still can't reproduce. There are different CSS things in play: redaction, white-space: pre-wrap, highlighting. I need to know what you do, what you expect to happen, what actually happens and what browser/OS including version you are using.

jfilter commented 6 years ago

Here is a demo: https://youtu.be/mcpDLoW0XTQ

When I highlight a text, press CMD + C and then CMD + P, I expect the line breaks to still be in the pasted text.

This problems exists for quite a while. I don't think it has to do with the browser / OS version. However, I use Firefox 59.0.2 and macOS 10.13.4.

stefanw commented 6 years ago

Interestingly, if you paste from Firefox into a "real" text editor (sublime, atom, vim etc.) the newlines are preserved. Notes.app (and possibly any formatting-aware editor) removes them, but only when pasting from Firefox. Looks like a bug in Firefox.

Working around this would be annoying, as the text behind it is styled with white-space: pre-wrap and would need to be converted to ps and brs behind the scenes to look the same on the page.

I propose you either use another browser or, more conveniently, copy&paste from firefox into a non-formatting text editor and then copy&paste to the word processor of your choice.

GiantCrocodile commented 6 years ago

I usually paste from Firefox to the very basic text editor of Windows and copy from there to insert into my word processor of my choice. But this doesn't work for me: In any editor I use, the pasted text has zero paragraphs. It's a complete one-liner.

I'm on Windows 10 with latest Firefox build.

jfilter commented 6 years ago

It's really a Firefox issue: https://www.google.com/search?q=firefox+copy+paste+line+break+lost

I guess you have to use another browser for this.

GiantCrocodile commented 6 years ago

It may be a FIrefox bug but this doesn't explain why the workaround works for Stefan but not for me. I would be fine with the additional editor-step.