private void serializeTreeToHtml() {
    HTMLExportUtil.writeFile(myOutputDir, "index.html", myTree.getContext().getProject(), w -> {
      String title = myTree.getContext().getView().getViewTitle();
      appendHeader(w, title);
      w.append("<div id=\"inspection-tree\">\n<h4>").append(title).append("</h4>\n");
      InspectionTreeTailRenderer<IOException> tailRenderer = new InspectionTreeTailRenderer<>(myTree.getContext()) {
        @Override
        protected void appendText(String text, SimpleTextAttributes attributes) throws IOException {
          w.append(escapeNonBreakingSymbols(text));
        }

        @Override
        protected void appendText(String text) throws IOException {
          w.append(escapeNonBreakingSymbols(text));
        }
      };
      w.append("\n<ol class=\"tree\">");
      traverseInspectionTree(myTree.getInspectionTreeModel().getRoot(), n -> {
        int nodeId = System.identityHashCode(n);
        w.append("\n<li><label for=\"")
          .append(String.valueOf(nodeId))
          .append("\">")
          .append(convertNodeToHtml(n))
          .append("&nbsp;<span class=\"grayout\">");
        tailRenderer.appendTailText(n);
        w.append("</span></label><input type=\"checkbox\"");
        if (isChecked(n)) {
          w.append(" checked");
        }
        w.append(" onclick=\"navigate(").append(String.valueOf(nodeId)).append(")\"");
        w.append(" id=\"").append(String.valueOf(nodeId)).append("\">");
        if (n instanceof SuppressableInspectionTreeNode) {
          RefEntity e = ((SuppressableInspectionTreeNode)n).getElement();
          if (e != null) {
            w.append("\n<div id=\"d").append(String.valueOf(nodeId)).append("\" style=\"display:none\">");
            StringBuilder buf = new StringBuilder();
            ((SuppressableInspectionTreeNode)n).getPresentation().getComposer().compose(buf, e);
            w.append(buf.toString());
            w.append("</div>");
          }
        }
        w.append("\n<ol class=\"tree\">");
      }, n -> w.append("\n</ol>"));
      w.append("""
                 
                 </ol>
                 </div>
                 <div id="description">
                   <h4>Problem description</h4>
                   <div id="preview">Select a problem element in tree</div>
                 </div>
                 </body>
                 </html>""");
    });

    InspectionTreeHtmlExportResources.copyInspectionReportResources(myOutputDir);
  }
private void serializeTreeToHtml()