The TagBuilder class in ASP.NET Core is useful outside of the context of ASP.NET Core. I would like to be able to use it in console applications, desktop applications, microservices and libraries for things such as creating HTML email and reports in HTML format.
API Proposal
namespace System.Text.Html;
/// <summary>
/// Contains methods and properties that are used to create HTML elements.
/// </summary>
public class TagBuilder : IHtmlContent
{
// ...
}
API Usage
var p = new TagBuilder("p");
p.SetContent("Hello world!");
Background and motivation
The
TagBuilder
class in ASP.NET Core is useful outside of the context of ASP.NET Core. I would like to be able to use it in console applications, desktop applications, microservices and libraries for things such as creating HTML email and reports in HTML format.API Proposal
API Usage
Alternative Designs
No response
Risks
No response