Zim

How to paste rich text?

Asked by Marcus

When I copy rich text (with bold, italics, etc.) from another application and paste it into Zim, it is pasted as plain text. Is there, or can there be, any way to paste with formatting?

If not, or meanwhile, can anyone suggest an easy workaround? (For example, use tool X to convert it to Syntax Y which if pasted into Zim will carry bold & italic formatting...)

Question information

Language:
English Edit question
Status:
Expired
For:
Zim Edit question
Assignee:
No assignee Edit question
Last query:
Last reply:
Revision history for this message
Jaap Karssenberg (jaap.karssenberg) said :
#1

On Aug 5, 2014 3:48 AM, "Marcus" <email address hidden>
wrote:

> New question #252637 on Zim:
> https://answers.launchpad.net/zim/+question/252637
>
> When I copy rich text (with bold, italics, etc.) from another application
> and paste it into Zim, it is pasted as plain text. Is there, or can there
> be, any way to paste with formatting?
>
> If not, or meanwhile, can anyone suggest an easy workaround? (For example,
> use tool X to convert it to Syntax Y which if pasted into Zim will carry
> bold & italic formatting...)
>

Afraid this is not yet supported. Reason is that it depends on the
applications what format they want to paste. Most common is HTML, but since
HTML is quite flexible it is harder to support. But will work on that.

Just for my information which application are you pasting from ?

Regards,

Jaap

Revision history for this message
Marcus (op132) said :
#2

My initial reason for pasting was to import entries from other programs in which I've taken notes, for example, OneNote, The Journal, ConnectedText, and Ecco Pro. My other reason was anticipating that in the future I might want to copy and paste things from applications such as Microsoft Word or Firefox without losing any bold, italic, or list formatting.

OneNote appears to be a special case, as pasting even text from that resulted in pasting images of the text into Zim. It looked perfect, but of course wasn't editable as text.

I just now tried a workaround, which kind of works, but sometimes causes two errors which I can't understand. Basically the idea is: copy rich text (from e.g Firefox, ConnectedText, The Journal), paste into KompoZer (Normal tab), copy HTML (from Source tab), paste into HTML-to-DokuWiki Converter (I downloaded the Windows version here: https://www.dokuwiki.org/tips:htmltowiki ), copy the DokuWiki Output, paste into a text file in my Zim notebook folder, save, close, reload the page in Zim.

The first time, from Firefox, it seemed to work fine. The second time, from ConnectedText, reloading the page in Zim gave the following error:

 Could not read: C:\[...]\Import_Test.txt
 This usually means the file contains invalid characters
 Details: 'utf8' codec can't decode byte 0x97 in position 900: invalid start byte

I couldn't see any unusual characters in the text file, so I gave up on this one.

The third time, from The Journal, it gave a very similar error (with a different byte number and position number), but after I tried deleting the blank lines at the end of the text file, then Zim loaded it without error. Perhaps the blank lines at the end of the DokuWiki to HTML Converter aren't agreeable to Zim? Now that I look at it, I see that there's a UTF-8 checkbox in the HTML to DokuWiki Converter which I didn't check; hopefully if I do, that will eliminate the problem.

The other error, which I also encountered twice, was that after I closed the text file (and AkelPad which was editing it) and reloaded it in Zim, Zim complained that it was unable to save the page because the file was being accessed. I even closed Windows Explorer; nothing else, I'm pretty sure, was accessing the file, but it kept complaining and refusing to save the file (except as a backup with a different name). After closing the notebook and re-opening it in Zim, the problem went away.

If I can consistently avoid both of these types of errors, this workaround might turn out to be a timesaver, as intended. Any insight?

Revision history for this message
Launchpad Janitor (janitor) said :
#3

This question was expired because it remained in the 'Open' state without activity for the last 15 days.