private EditorInlineHtmlPane createEditorPane(@NotNull Editor editor,
                                                @Nls @NotNull String text,
                                                @Nullable Color backgroundColor,
                                                boolean reusable) {
    EditorInlineHtmlPane pane = new EditorInlineHtmlPane(!reusable, editor);
    pane.getCaret().setSelectionVisible(!reusable);
    pane.setBorder(JBUI.Borders.empty());
    Map<TextAttribute, Object> fontAttributes = new HashMap<>();
    fontAttributes.put(TextAttribute.SIZE, JBUIScale.scale(DocumentationFontSize.getDocumentationFontSize().getSize()));
    // disable kerning for now - laying out all fragments in a file with it takes too much time
    fontAttributes.put(TextAttribute.KERNING, 0);
    pane.setFont(pane.getFont().deriveFont(fontAttributes));
    EditorColorsScheme scheme = editor.getColorsScheme();
    Color textColor = getTextColor(scheme);
    pane.setForeground(textColor);
    pane.setBackground(backgroundColor != null ? backgroundColor : ((EditorEx)editor).getBackgroundColor());
    pane.setSelectedTextColor(textColor);
    pane.setSelectionColor(editor.getSelectionModel().getTextAttributes().getBackgroundColor());
    UIUtil.enableEagerSoftWrapping(pane);
    pane.setText(text);
    pane.addHyperlinkListener(e -> {
      if (e.getEventType() == HyperlinkEvent.EventType.ACTIVATED) {
        myLinkActivationHandler.activateLink(e, this);
      }
    });
    pane.getDocument().putProperty("imageCache", IMAGE_MANAGER.getImageProvider());
    return pane;
  }
private EditorInlineHtmlPane createEditorPane(@NotNull Editor editor,
                                                @Nls @NotNull String text,
                                                @Nullable Color backgroundColor,
                                                boolean reusable)