When pasting text into the editor using Firefox, it incorrectly formats the text

Some of my users identified this issue and I was able to reproduce it on my forum as well as here.

Specifically what is happening is the editor is changing the formatting of the pasted text, either by adding new lines where there were none, or removing them.

What it should look like:

“Hello. My name is David, and I’m a quinquagenerian.”

Game industry veteran David Mullich kicked off a panel discussion on game industry ageism today at the 2015 Game Developers Conference like he was introducing himself at a group therapy session.

It was a light-hearted way to address an insidious problem.

It turns out like this:

“Hello. My name is David, and I’m a quinquagenerian.”

Game industry veteran
David Mullich kicked off a panel discussion on game industry ageism
today at the 2015 Game Developers Conference like he was introducing
himself at a group therapy session.

It was a light-hearted way to address an insidious problem.

Source of above text: news

One of my users had to paste the text into a text editor then into the edit box to get the intended formatting.

I honestly don’t know if this is a Firefox bug or a Discourse bug, but other text inputs on Firefox don’t display this issue in my testing.

If I copy and paste the properly formatted text from this post back into here, I get this:

“Hello. My name is David, and I’m a quinquagenerian.”Game
industry veteran David Mullich kicked off a panel discussion on game
industry ageism today at the 2015 Game Developers Conference like he was
introducing himself at a group therapy session. It was a light-hearted way to address an insidious problem.

This is from the first improperly formatted result from before:

“Hello. My name is David, and I’m a quinquagenerian.”Game industry veteran
David Mullich kicked off a panel discussion on game industry ageism
today at the 2015 Game Developers Conference like he was introducing
himself at a group therapy session. It was a light-hearted way to address an insidious problem.

Notice the slight difference in where it inserted the new lines?

Also noticed that sometimes when pasting in some text on Firefox, the preview doesn’t reflect the new text until I make another change.

Firefox is weird.

  • Copy from Firefox, paste in Firefox → as reported.
  • Copy from Chrome, paste in Firefox → no newlines at all.
  • Copy from Chrome, paste in Notepad, copy again and paste in Firefox → works.
  • Copy from Firefox and paste in Chrome → works too.

My guess is that both browsers put richtext into the clipboard, and Firefox has problems with pasting that into a plaintext input field. Or could it be that Discourse somehow makes FF think that the editor supports richtext?

5개의 좋아요

Any help with this? I guess I expect at least someone from the core team to respond. If I had more time I would look into it myself, but I won’t have time for a week or more. :frowning:

Sounds like a plausible bug, we will get to it at some point but not sure if in the next couple of weeks.

2개의 좋아요

Thanks, wasn’t expecting a fast fix.

I can still reproduce this and it bugs me because it makes longer texts unreadable (or I have to reformat pasted text). There is a reason why people use newlines and this Discourse/Firefox behaviour I experience ridicules the idea of newlines.

I’m on Firefox 47.0 and we are using Discourse v1.6.0.beta8 +25.

1개의 좋아요

Using Ctrl+v to paste produces the weird formatting as reported. Pasting with the middle button doesn’t.

Currently Firefox 47 on Ubuntu Gnome 16.04, but it’s been like this on Ubuntu for as long as I can remember.

1개의 좋아요

이 오래된 버그 보고서를 발견했습니다. Mac에서 Firefox를 사용해 테스트해 보았지만 재현이 되지 않습니다. 이 문제를 여전히 겪고 계신 분이 있다면 재현 단계를 공유해 주세요. 그렇지 않으면 타이머가 끝나면 이 주제를 닫을 예정입니다.

3개의 좋아요

이 주제는 마지막 답변 후 30일이 지나면 자동으로 닫힙니다. 더 이상 새 답변을 작성할 수 없습니다.