Perhaps the source code of the helper will shed light on the solution to your problem. Anyway, they helped me when I customized the a-taghelper
https://github.com/dotnet/aspnetcore/blob/main/src/Mvc/Mvc.TagHelpers/src/AnchorTagHelper.cs