Skip to content
This repository was archived by the owner on Dec 14, 2018. It is now read-only.
This repository was archived by the owner on Dec 14, 2018. It is now read-only.

Rename AppendEncoded() to AppendHtml() and SetContentEncoded() to SetHtmlContent() #3225

Closed
@kichalla

Description

@kichalla

In the following tag helper, I am using AppendEncoded to append <b> even though its not really encoded and is just raw content.

@NTaylorMullen suggested AppendRaw which seems like a good name to indicate what it does.

[HtmlTargetElement("greeting")]
public class GreetingTagHelper : TagHelper
{
    public string text { get; set; }

    public override void Process(TagHelperContext context, TagHelperOutput output)
    {
        output.TagName = null;
        output.Content.AppendEncoded("<b>");
        output.Content.Append(text);
        output.Content.AppendEncoded("</b>");
    }
}

@rynowak @dougbu

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions