Skip to content

Commit d30dfb1

Browse files
author
Warren Buckley
committed
Minor changes needed after a bit of manual testing
1 parent 190a107 commit d30dfb1

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

Our.Umbraco.TagHelpers/LinkTagHelper.cs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,12 +19,16 @@ public override async Task ProcessAsync(TagHelperContext context, TagHelperOutpu
1919
return;
2020
}
2121

22+
// If the <our-link /> is self closing
23+
// Ensure that our <a></a> always has a matching end tag
24+
output.TagMode = TagMode.StartTagAndEndTag;
25+
2226
output.TagName = "a";
2327
var childContent = await output.GetChildContentAsync();
2428

2529
// If we use the TagHelper <umb-link></umb-link>
2630
// Without child DOM elements then it will use the Link Name property inside the <a> it generates
27-
if (childContent == null)
31+
if (childContent.IsEmptyOrWhiteSpace)
2832
{
2933
output.Content.SetContent(Link.Name);
3034
}

0 commit comments

Comments
 (0)