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

Django REST Framework perform_create: You cannot call `.save()` after accessing `serializer.data` -

Why does Go error when trying to marshal this JSON? -