smart paste from Google Docs

sbodoff
Posts: 20
Joined: Tue Jun 14, 2011 10:42 pm

smart paste from Google Docs

Post by sbodoff » Mon Jan 21, 2013 8:57 pm

A common scenario is for developers to provide content in Google Docs. However, when I paste lists from Google Docs directly or from any format generated from Google Docs into a DITA topic, the list formatting is lost and the bullets or list numbers are included as part of the content. Is there any way to correct this?

Radu
Posts: 6539
Joined: Fri Jul 09, 2004 5:18 pm

Re: smart paste from Google Docs

Post by Radu » Tue Jan 22, 2013 9:41 am

Hi,

What version of Oxygen are you using?

What Oxygen does when content is pasted in it is to see if it also comes as an HTML flavor and it it does, Oxygen has conversion stylesheets which try to convert that HTML content to the target content (DITA or Docbook or TEI).
I tested pasting a small numbered list from Google Docs to an opened DITA topic (Oxygen 14.1) and it worked for me, Oxygen created an <ol> with list items inside.
Could you also check if this works for you with a small numbered list? If it does, the problem may be particular to a certain content. If so, maybe you could share a sample document which has this problem and we could try to perform some more tests on it.

Regards,
Radu
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com

sbodoff
Posts: 20
Joined: Tue Jun 14, 2011 10:42 pm

Re: smart paste from Google Docs

Post by sbodoff » Wed Jan 23, 2013 3:42 am

I tried again copying directly from Google Docs instead of writing to a Word document and that converted lists correctly. However, paragraphs marked as "Normal text" are not enclosed in a <p> tag and are thus invalid. See "Some text" and "More text" below. Also, is there any way to mark up code samples in a Google doc and have it be converted to <codeblock> or <codeph>?

<topic id="topic_udw_yrc_z3">
<title>Topic title</title>
<topic id="topic_zcv_csc_z3">
<title>A Heading</title>
<body>Some text<ul id="ul_gdv_csc_z3">
<li>
<p>A bullet</p>
</li>
<li>
<p>Another bullet</p>
</li>
</ul>More text<ol id="ol_jdv_csc_z3">
<li>
<p>A list item</p>
</li>
<li>
<p>Another list item</p>
</li>
</ol></body>
</topic>
</topic>

Radu
Posts: 6539
Joined: Fri Jul 09, 2004 5:18 pm

Re: smart paste from Google Docs

Post by Radu » Wed Jan 23, 2013 10:10 am

Hi,

I had more luck preserving the original formatting by choosing File->Download as Open Document Format then by opening the ODT file in Libre Office, select all, copy and then pasting in Oxygen.
Exporting to HTML, opening in the web browser and copy pasting from there also seemed to preserve the normal text as paragraphs.
Also, is there any way to mark up code samples in a Google doc and have it be converted to <codeblock> or <codeph>?
I have no idea, maybe you should google for it. From what I searched, probably not.

Oxygen also has a web component (Java applet) so if you'll ever want to test this approach:

http://www.oxygenxml.com/oxygen_sdk.htm ... _component

Regards,
Radu
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com

sbodoff
Posts: 20
Joined: Tue Jun 14, 2011 10:42 pm

Re: smart paste from Google Docs

Post by sbodoff » Thu Mar 05, 2015 1:19 am

Lately pasting from a Google Doc in Chrome doesn't work at all. I'm getting this error:

Could not retrieve the HTML content from the clipboard.
The text content will be used instead.
Reason: Resetting to invalid mark

The content is pasted as plain text with no markup.

This is on MacOS Yosemite.

Is there any workaround? I've tried exporting to Word, ODT, and rtf with the same result.

Radu
Posts: 6539
Joined: Fri Jul 09, 2004 5:18 pm

Re: smart paste from Google Docs

Post by Radu » Thu Mar 05, 2015 9:57 am

Hi,

The default Oxygen kit for Mac OSX comes without the Java VM bundled and it runs using the Java 1.6 installed on the Mac. I can reproduce the problem with it.
But I also tested using Java 1.8 for running Oxygen and copy/paste from google docs worked.
What version of Oxygen are you using?

For example we have an Oxygen 16.1 kit which comes bundled with Java 1.8:

http://www.oxygenxml.com/InstData/Edito ... gen.tar.gz

But you can also install Java 1.8 separately on your Mac. If you have an older Oxygen version it might have not been tested with Java 1.8 so you might encounter problems using it.

Regards,
Radu
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com

sbodoff
Posts: 20
Joined: Tue Jun 14, 2011 10:42 pm

Re: smart paste from Google Docs

Post by sbodoff » Fri Mar 06, 2015 4:24 am

At 16.1, so using Java 1.8 is fine. Thank you for the fix.

Post Reply