Smart Paste not converting CRs to new <p>s?
Having trouble installing Oxygen? Got a bug to report? Post it all here.
-
- Posts: 26
- Joined: Tue Oct 28, 2014 1:19 pm
Smart Paste not converting CRs to new <p>s?
I have a pretty simple "Smart Paste" wish: I just want it to convert carriage returns into new <p> elements.
I have "Convert external content on paste" enabled, along with all the other options under "Schema Aware".
However whether I paste from a text editor, Word or whatever, it still just creates one massive <p> element.
Shouldn't this work?
I'm using XML Editor 16.2.
regards, Dan
I have "Convert external content on paste" enabled, along with all the other options under "Schema Aware".
However whether I paste from a text editor, Word or whatever, it still just creates one massive <p> element.
Shouldn't this work?
I'm using XML Editor 16.2.
regards, Dan
-
- Posts: 4141
- Joined: Fri Mar 28, 2003 2:12 pm
Re: Smart Paste not converting CRs to new <p>s?
Post by sorin_ristache »
Hi,
What puts the "Smart" in "Smart Paste" is preserving the markup semantics between source and destination, for example replacing a ul/li sequence of elements in the browser (the source of the copy operation) with a sequence itemizedlist/listitem in the destination (a DocBook XML document). Adding (inventing) a synthetic markup element like <p> in the destination when no semantic equivalent was present in the source (only a LF character or a CR LF sequence was present in the source) would violate this markup preservation property, which would be kind of surprising from the user's perspective. If the used had meant a new paragraph element at the location of the newline character she would have used a <p> element in the source document instead of a newline character.
Having said that, it is always possible to customize the processing of the source markup in your Oxygen installation. If you tell us the destination language (DITA, or DocBook, or TEI) and give an example of input fragment and expected output markup, maybe I can help you to do this customization.
What puts the "Smart" in "Smart Paste" is preserving the markup semantics between source and destination, for example replacing a ul/li sequence of elements in the browser (the source of the copy operation) with a sequence itemizedlist/listitem in the destination (a DocBook XML document). Adding (inventing) a synthetic markup element like <p> in the destination when no semantic equivalent was present in the source (only a LF character or a CR LF sequence was present in the source) would violate this markup preservation property, which would be kind of surprising from the user's perspective. If the used had meant a new paragraph element at the location of the newline character she would have used a <p> element in the source document instead of a newline character.
Having said that, it is always possible to customize the processing of the source markup in your Oxygen installation. If you tell us the destination language (DITA, or DocBook, or TEI) and give an example of input fragment and expected output markup, maybe I can help you to do this customization.
Does that mean that you get no markup at all in the destination language in Oxygen Author editing mode? If yes, you may have just hit the fallback for the case when some text content in the source fragment is lost by Smart Paste's normal processing: skip the Smart Paste processing (which would lose some text content) and only join the text content in the source into one long text and surround it with a <p> element in the destination document. Please can you send us a sample Word document for reproducing this problem, or point us to a web page where we can copy some fragment and reproduce this problem?DanTemple wrote:However whether I paste from a text editor, Word or whatever, it still just creates one massive <p> element.
Regards,
Sorin
<oXygen/> XML Editor Support
Sorin
<oXygen/> XML Editor Support
-
- Posts: 26
- Joined: Tue Oct 28, 2014 1:19 pm
Re: Smart Paste not converting CRs to new <p>s?
An example to reproduce would be any .txt file from Notepad with at least one newline. I.e the source has no actual markup, apart from the CR/LF.
If I paste this into Word or Frame, I get two paragraphs as expected. It also works as expected pasting from Word/Frame/Browser -> emacs/Frame/Word whatever.
But not in Oxygen. I'm not sure from your mail whether you are saying this is expected or not?
When editing by hand, if I press Enter within a <p> element I get asked if I want to "split <p>" - basically I want this same functionality when I paste text with newlines, except I would like it to default to "yes".
I also note that pasting multiple paragraphs from Word -> Oxygen or Browser-> Oxygen also strips the paragraphs out and results in one long <p>.
regards, Dan
If I paste this into Word or Frame, I get two paragraphs as expected. It also works as expected pasting from Word/Frame/Browser -> emacs/Frame/Word whatever.
But not in Oxygen. I'm not sure from your mail whether you are saying this is expected or not?
When editing by hand, if I press Enter within a <p> element I get asked if I want to "split <p>" - basically I want this same functionality when I paste text with newlines, except I would like it to default to "yes".
I also note that pasting multiple paragraphs from Word -> Oxygen or Browser-> Oxygen also strips the paragraphs out and results in one long <p>.
regards, Dan
-
- Posts: 4141
- Joined: Fri Mar 28, 2003 2:12 pm
Re: Smart Paste not converting CRs to new <p>s?
Post by sorin_ristache »
This is expected. Smart Paste acts on structural markup in the source document, like paragraphs, lists and sections in a Word document (copy from MS Word, or LibreOffice, or OpenOffice, etc) or in a web page (copy from Chrome, or Firefox, etc), not on plain text.DanTemple wrote:An example to reproduce would be any .txt file from Notepad with at least one newline. I.e the source has no actual markup, apart from the CR/LF.
If I paste this into Word or Frame, I get two paragraphs as expected. It also works as expected pasting from Word/Frame/Browser -> emacs/Frame/Word whatever.
But not in Oxygen. I'm not sure from your mail whether you are saying this is expected or not?
We will consider applying this basic processing on plain text in a future version: convert newline characters to new paragraph elements, so that one <p> element is created in the target document for each newline in the source document.
This is not expected. You should get one distinct paragraph in the destination for each paragraph in the source. You may have hit the fallback case for Smart Paste processing because apparently the normal Smart Paste processing was not able to transfer the entire text context to the target document. If you can send us an example Word document or give us a web page URL pointer then we will look into it and fix it.DanTemple wrote:I also note that pasting multiple paragraphs from Word -> Oxygen or Browser-> Oxygen also strips the paragraphs out and results in one long <p>.
The latest version is 16.1. Did you mean Oxygen version 15.2?DanTemple wrote:I'm using XML Editor 16.2.
Regards,
Sorin
<oXygen/> XML Editor Support
Sorin
<oXygen/> XML Editor Support
-
- Posts: 26
- Joined: Tue Oct 28, 2014 1:19 pm
Re: Smart Paste not converting CRs to new <p>s?
Sorry - 16.1 it is.
But yes - that would be a better default (I think) to create new <p>s. Hope you decide to implement!
I should maybe mention I am running on Oxygen on Linux over VNC? This might affect the paste function? I just checked, and on Word it works OK pasting to Oxygen on Windows.
As a test file you can just type any two paragraphs into a new Word document.
regards, Dan
But yes - that would be a better default (I think) to create new <p>s. Hope you decide to implement!
I should maybe mention I am running on Oxygen on Linux over VNC? This might affect the paste function? I just checked, and on Word it works OK pasting to Oxygen on Windows.
As a test file you can just type any two paragraphs into a new Word document.
regards, Dan
-
- Posts: 4141
- Joined: Fri Mar 28, 2003 2:12 pm
Re: Smart Paste not converting CRs to new <p>s?
Post by sorin_ristache »
That could explain why copy from Word to Oxygen creates only one <p> element in Oxygen Author mode instead of one <p> element for each paragraph in the Word document. The only solution that I can see in this case is to copy and paste between Word and Oxygen directly, as applications running on the local machine, not through a VNC client window.DanTemple wrote:I should maybe mention I am running on Oxygen on Linux over VNC? This might affect the paste function?
If I select two or more paragraphs in a Word document, copy them and paste in Author mode, I get one <p> element in Author mode per each paragraph in the Word document.DanTemple wrote:I just checked, and on Word it works OK pasting to Oxygen on Windows.
As a test file you can just type any two paragraphs into a new Word document.
Regards,
Sorin
<oXygen/> XML Editor Support
Sorin
<oXygen/> XML Editor Support
-
- Posts: 9449
- Joined: Fri Jul 09, 2004 5:18 pm
Re: Smart Paste not converting CRs to new <p>s?
Hi,
Just to update this older thread, with Oxygen 18.0 if you copy a couple of lines of text from Notepad, Oxygen by default will attempt to create paragraphs for each of them.
Regards,
Radu
Just to update this older thread, with Oxygen 18.0 if you copy a couple of lines of text from Notepad, Oxygen by default will attempt to create paragraphs for each of them.
Regards,
Radu
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com
<oXygen/> XML Editor
http://www.oxygenxml.com
Jump to
- Oxygen XML Editor/Author/Developer
- ↳ Feature Request
- ↳ Common Problems
- ↳ DITA (Editing and Publishing DITA Content)
- ↳ Artificial Intelligence (AI Positron Assistant add-on)
- ↳ SDK-API, Frameworks - Document Types
- ↳ DocBook
- ↳ TEI
- ↳ XHTML
- ↳ Other Issues
- Oxygen XML Web Author
- ↳ Feature Request
- ↳ Common Problems
- Oxygen Content Fusion
- ↳ Feature Request
- ↳ Common Problems
- Oxygen JSON Editor
- ↳ Feature Request
- ↳ Common Problems
- Oxygen PDF Chemistry
- ↳ Feature Request
- ↳ Common Problems
- Oxygen Feedback
- ↳ Feature Request
- ↳ Common Problems
- Oxygen XML WebHelp
- ↳ Feature Request
- ↳ Common Problems
- XML
- ↳ General XML Questions
- ↳ XSLT and FOP
- ↳ XML Schemas
- ↳ XQuery
- NVDL
- ↳ General NVDL Issues
- ↳ oNVDL Related Issues
- XML Services Market
- ↳ Offer a Service