internal static IMarkdownInLine ToMDLink(DotNetCommentQualifiedLink commentLink, DotNetMember parent = null) { DotNetQualifiedName _namespace = null; if (parent != null) { _namespace = (parent is DotNetType) ? parent.Name : parent.Name.FullNamespace; } string text = commentLink.Name.ToDisplayString(_namespace); string url = commentLink.Name.ToStringLink(); if (url.Contains("http")) { return(new MarkdownInlineLink(text, url)); } if (url.EndsWith(Ext.MD)) { if (parent == null || parent.Name != commentLink.Name.FullNamespace) { return(new MarkdownInlineLink(text, url)); } } return(new MarkdownText(text)); }
public void DotNetCommentQualifiedLink_FromXml_TypeLink() { //arrange string fullNamespace = "System.X"; string typeName = "ArgumentException"; string qualifiedName = fullNamespace + "." + typeName; //act DotNetCommentQualifiedLink result = DotNetCommentQualifiedLink.FromVisualStudioXml(qualifiedName); //assert Assert.AreEqual(qualifiedName, result.FullName); }