Skip to content

Commit

Permalink
Merge pull request #537 from poppastring/comments-home-page
Browse files Browse the repository at this point in the history
Home page Comment link 

close #535
  • Loading branch information
poppastring authored Mar 12, 2021
2 parents 4a69ebd + 28d73fa commit e8b77a4
Showing 1 changed file with 7 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand Down

0 comments on commit e8b77a4

Please sign in to comment.