private boolean appendLink(@NotNull StringBuilder sb, @NotNull PsiElement element) {
    try {
      String name = getLinkReferenceText(element);
      if (!StringUtil.isEmpty(name)) {
        sb.append("<code><a href=\"#").append(getLinkProtocol()).append("/").append(name).append("\">");
        return true;
      }
      VirtualFile file = getVirtualFile(element);
      if (file == null) return false;

      int offset = element.getTextOffset();
      sb.append("<code><a href=\"#navigation/");
      sb.append(toSystemIndependentName(file.getPath()));
      sb.append(":").append(offset).append("\">");
      return true;
    }
    catch (Exception ignored) {
      return false;
    }
  }
private boolean appendLink(@NotNull StringBuilder sb, @NotNull PsiElement element)