diff --git a/source/DasBlog.Web.UI/TagHelpers/Comments/CommentUserHomePageLink.cs b/source/DasBlog.Web.UI/TagHelpers/Comments/CommentUserHomePageLink.cs index dfc1f87b..470ea3fe 100644 --- a/source/DasBlog.Web.UI/TagHelpers/Comments/CommentUserHomePageLink.cs +++ b/source/DasBlog.Web.UI/TagHelpers/Comments/CommentUserHomePageLink.cs @@ -13,15 +13,19 @@ public class CommentUserHomePageLink : TagHelper public override void Process(TagHelperContext context, TagHelperOutput output) { - output.TagName = "a"; output.TagMode = TagMode.StartTagAndEndTag; if (Comment.HomePageUrl?.Length > 0) { + output.TagName = "a"; output.Attributes.SetAttribute("href", Comment.HomePageUrl); + output.Attributes.SetAttribute("rel", "nofollow"); } - - output.Attributes.SetAttribute("rel", "nofollow"); + else + { + output.TagName = "span"; + } + output.Attributes.SetAttribute("class", "dbc-comment-user-homepage-name"); output.Content.SetHtmlContent(Comment.Name); }