void (StringBuilder buffer, PsiFile packageHtmlFile, boolean generatePrologue) { String htmlText = packageHtmlFile.getText(); try { Element rootTag = JDOMUtil.load(htmlText); Element subTag = rootTag.getChild("body"); if (subTag != null) { htmlText = subTag.getValue(); } } catch (JDOMException | IOException ignore) { } htmlText = StringUtil.replace(htmlText, "*/", "&#42;&#47;"); String fileText = "/** " + htmlText + " */"; PsiElementFactory elementFactory = JavaPsiFacade.getElementFactory(packageHtmlFile.getProject()); PsiDocComment docComment; try { docComment = elementFactory.createDocCommentFromText(fileText); } catch (IncorrectOperationException e) { LOG.error(e); return; } if (generatePrologue) generatePrologue(buffer); generateCommonSection(buffer, docComment); buffer.append(DocumentationMarkup.SECTIONS_END); }