Object (@NotNull @NonNls String dataId) { if (DocumentationManager.SELECTED_QUICK_DOC_TEXT.is(dataId)) { // Javadocs often contain &nbsp; symbols (non-breakable white space). We don't want to copy them as is and replace // with raw white spaces. See IDEA-86633 for more details. String selectedText = myEditorPane.getSelectedText(); return selectedText == null ? null : selectedText.replace((char)160, ' '); } return null; }