tomboy-notes / tomboy-ng

Next generation of Tomboy
MIT License
389 stars 38 forks source link

A couple of issues with pasting text from webpages #130

Closed corypanshin closed 4 years ago

corypanshin commented 4 years ago

I've just been collecting some quotes from webpages and have run into a couple of problems. (This is version 0.25, Windows 7, Waterfox).

One is that it's happened a couple of times now that I pasted a quote of two or three paragraphs, closed the note, and when I reopened it the final paragraph was gone.

The other is that in one of those cases, when I repasted the missing paragraph, the quotation marks and apostrophes were all doubled.

I've been able to reproduce the error, but not consistently. I can't spot a pattern in when it happens and when it doesn't.

davidbannon commented 4 years ago

corypanshin, thanks for the report. Just to clarify, the missing paragraph problem, after you have pasted, are you sure everything you expect is there, visible, in the note ? And its after a close / open cycle that it goes away ? If is only some part of your paste appearing in the note immediately after the paste ?

My guess is that the browser you are using is including some html in the paste, that html is clashing with xml in the tomboy-ng standard. But thats pretty vague ! I would really like to know how to replicate the problem....

tomboy-ng accepts only two paste formats, plain text and rtf, I'd be quite surprised if your browser is offering rtf. Perhaps as well as checking the whole paste is there, you could also check to see if you see any unexpected angle brackets ?

Davo

corypanshin commented 4 years ago

I haven't encountered the problem again in the last day or two. I suspect it only affects pasting from certain webpages. But I'm keeping an eye out for further occurrences. One possibility is that it might have occurred when I pasted text from two different webpages into the same note. Another is that it might happened when the page I was pasting from used blockquotes or italics. I'll keep looking for all those things.

corypanshin commented 4 years ago

I have now found two notes where the final paragraphs had disappeared since yesterday. One of those paragraphs was copied from This webpage. The note in question consisted of that url, followed by a couple of lines I typed in, and then by this pasted text block (below) which in the original story includes both italics and a link.

GlobalOptions recently went public and a 10-K filing with the Securities and Exchange Commission says that its “foreign clients operate primarily in Russia and the Caribbean.” The Wall Street Journal has reported that GlobalOptions has worked for a Cyprus-based firm called Highrock Holdings, which is controlled by a shady Ukrainian businessman named Dimytro Firtash. “In 2003-2005, Mr. Firtash brokered several billion-dollar deals between Gazprom and the government of Ukraine,” the Journal said. “They netted big profits for Highrock–and criticism from the U.S. ambassador to the Ukraine at the time for the deals’ lack of transparency . . . [I]n a recent lawsuit filed by GlobalOptions against Highrock claiming unpaid bills, the security firm alleged that Mr. Firtash hired GlobalOptions for an unspecified ‘special operation’ on behalf of a Ukrainian government official.”

corypanshin commented 4 years ago

The other note includes text pasted from This webpage.
zander

I am not certain, but I believe several paragraphs had disappeared from the end. I have attached a screenshot of the part of the note that shows a break between the last of the paragraphs that remained and the first of those I just re-added. The re-added ones appear to be in a different font.

That same change of font occurred in a few notes I created some days ago. When I returned to them, the font was now the same in all paragraphs, and nothing had been lost.

davidbannon commented 4 years ago

Yep, I can replicate that Cory. I am not sure why its happening but I can get the result you describe. I think it might be one of two things -

  1. embedded codes in the content messing with KControls. Something that looks like rtf code.
  2. The fact that we don't have a newline at the end of content.

I am leaning towards 2) right now, I have had an issue a bit similar to that in the past, and its possibly an easier, will investigate more.

Davo

davidbannon commented 4 years ago

Yep, thats it. I am amazed we have not discovered it earlier, been there since day one. If you paste content that itself does not end with a newline and there is not already a newline at the end, you loose the last line of (plain) text. You can avoid it by putting a newline at the end of of your note. Will be fixed in next release and I can cut you a new version with the fix now if you like.

Thanks Cory !

corypanshin commented 4 years ago

If it's as simple as hitting Enter after the pasted text, I can do that easily enough. I'll wait for the next release to get the fix. Thanks.

davidbannon commented 4 years ago

OK, this bug is finally fixed.
And, given how long it has been there, thats a good thing ! Thanks for great bug report ! Davo