private String getSelectedHtmlText() {
		Document doc = getDocument();
		int start = getSelectionStart();
		int end = getSelectionEnd();
		try {
			Position startPos = doc.createPosition(start);
			Position endPos = doc.createPosition(end);

			int startOffset = startPos.getOffset();
			int endOffset = endPos.getOffset();
			int size = endOffset - startOffset;
			StringWriter stringWriter = new StringWriter(size);
			getEditorKit().write(stringWriter, doc, startOffset, size);
			String text = stringWriter.toString();
			return text;
		}
		catch (BadLocationException | IOException e) {
			Msg.error(this, "Unable to extract HTML text from editor pane", e);
		}
		return null;
	}
Overridden to allow copying HTML content in its display form, without formatting.  The
default Java copy action will call this method.
Ghidra/Framework/Docking/src/main/java/docking/widgets/textpane/GHtmlTextPane.java