static @NlsSafe String generateHtmlAdditionalDocTemplate(@NotNull PsiElement element) {
    StringBuilder buf = new StringBuilder();
    final PsiFile containingFile = element.getContainingFile();
    if (containingFile != null) {
      final XmlTag tag = PsiTreeUtil.getParentOfType(element, XmlTag.class, false);
      boolean append;
      if (tag instanceof HtmlTag) {
        append = true;
      }
      else {
        final FileViewProvider provider = containingFile.getViewProvider();
        Language language;
        if (provider instanceof TemplateLanguageFileViewProvider) {
          language = ((TemplateLanguageFileViewProvider)provider).getTemplateDataLanguage();
        }
        else {
          language = provider.getBaseLanguage();
        }

        append = language == XHTMLLanguage.INSTANCE;
      }

      if (tag != null && append) {
        var documentation = MdnDocumentationKt.getHtmlMdnDocumentation(tag, tag);
        if (documentation != null && documentation.getUrl() != null) {
          buf.append("<br>");
          buf.append(XmlBundle.message("html.quickdoc.additional.template", documentation.getUrl()));
        }
      }
    }

    return buf.toString();
  }
static @NlsSafe String generateHtmlAdditionalDocTemplate(@NotNull PsiElement element)