private static void appendHighlightedByLexerAndEncodedAsHtmlCodeSnippet(
    boolean doSyntaxHighlighting,
    boolean isForRenderedDoc,
    @NotNull StringBuilder buffer,
    @NotNull Project project,
    @NotNull Language language,
    @Nullable String codeSnippet
  ) {
    if (doSyntaxHighlighting) {
      HtmlSyntaxInfoUtil.appendHighlightedByLexerAndEncodedAsHtmlCodeSnippet(
        buffer, project, language, codeSnippet, DocumentationSettings.getHighlightingSaturation(isForRenderedDoc));
    }
    else if (codeSnippet != null) {
      buffer.append(StringUtil.escapeXmlEntities(codeSnippet));
    }
  }
private static void appendHighlightedByLexerAndEncodedAsHtmlCodeSnippet(
    boolean doSyntaxHighlighting,
    boolean isForRenderedDoc,
    @NotNull StringBuilder buffer,
    @NotNull Project project,
    @NotNull Language language,
    @Nullable String codeSnippet
  )