java - JtextEditorPane - How to prevent copy and paste from wrapping text in html paragraph tags? -


i have:

htmldocument document = new htmldocument(); jtextpane htmleditorpane = new jtextpane(document) htmleditorpane.setcontenttype("text/html"); 

i select text in middle of sentence , call (wrapped in appropriate actionlisteners):

htmleditorpane.copy(); htmleditorpane.paste(); 

for whatever reason whenever text copy , pasted wrapped in <p> tags. how can keep formatting <p> tags seem added?

use getdefaultrootelement() , investigate children of root. there should head , body. go deeper , check children of children.

you can use tool check document's , view's structure.


Comments

Popular posts from this blog

html - Styling progress bar with inline style -

java - Oracle Sql developer error: could not install some modules -

How to use autoclose brackets in Jupyter notebook? -