16 lines
428 B
C#
16 lines
428 B
C#
using Microsoft.AspNetCore.Razor.TagHelpers;
|
|
|
|
namespace zero.TagHelpers;
|
|
|
|
[HtmlTargetElement("app-multiline", Attributes = "text")]
|
|
public class MultilineTagHelper : TagHelper
|
|
{
|
|
[HtmlAttributeName("text")]
|
|
public string Text { get; set; }
|
|
|
|
public override void Process(TagHelperContext context, TagHelperOutput output)
|
|
{
|
|
output.TagName = string.Empty;
|
|
output.Content.SetHtmlContent(Text.NewLinesToBr());
|
|
}
|
|
} |