Skip to content

Commit e8b77a4

Browse files
authored
Merge pull request #537 from poppastring/comments-home-page
Home page Comment link close #535
2 parents 4a69ebd + 28d73fa commit e8b77a4

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

source/DasBlog.Web.UI/TagHelpers/Comments/CommentUserHomePageLink.cs

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,15 +13,19 @@ public class CommentUserHomePageLink : TagHelper
1313

1414
public override void Process(TagHelperContext context, TagHelperOutput output)
1515
{
16-
output.TagName = "a";
1716
output.TagMode = TagMode.StartTagAndEndTag;
1817

1918
if (Comment.HomePageUrl?.Length > 0)
2019
{
20+
output.TagName = "a";
2121
output.Attributes.SetAttribute("href", Comment.HomePageUrl);
22+
output.Attributes.SetAttribute("rel", "nofollow");
2223
}
23-
24-
output.Attributes.SetAttribute("rel", "nofollow");
24+
else
25+
{
26+
output.TagName = "span";
27+
}
28+
2529
output.Attributes.SetAttribute("class", "dbc-comment-user-homepage-name");
2630
output.Content.SetHtmlContent(Comment.Name);
2731
}

0 commit comments

Comments
 (0)