Mapping between selected text and HTML JEditorPane
[nobr]Hi everybody,
I use a JEditorPane to display some HTML in which my users can make selection. If a selection is made I have to retrieve the HTML which is selected in order to perform some processing.
For example:
I display the following HTML:
<html>
<head></head>
<body>
<h1>This is a page</h1>
This is text.<br />It includes a break!
</body>
</html>
Now imagine my user makes a selection in the JEditorPane, for example: "text.
It includes". I get "text. It includes" back from pane.getSelectedText(), so I miss the underlying HTML. I am looking for a way to retrieve the underlying HTML of a selection. Perhaps there is a mapping or another way to retrieve this?
Best regards,
Jethro Borsje[/nobr]

