parent
7ed6a6cb57
commit
14c96f695a
|
|
@ -136,9 +136,9 @@ namespace Microsoft.AspNet.Html.Abstractions
|
||||||
/// <param name="builder">The <see cref="IHtmlContentBuilder"/>.</param>
|
/// <param name="builder">The <see cref="IHtmlContentBuilder"/>.</param>
|
||||||
/// <param name="content">The HTML encoded <see cref="string"/> to append.</param>
|
/// <param name="content">The HTML encoded <see cref="string"/> to append.</param>
|
||||||
/// <returns>The <see cref="IHtmlContentBuilder"/>.</returns>
|
/// <returns>The <see cref="IHtmlContentBuilder"/>.</returns>
|
||||||
public static IHtmlContentBuilder AppendLineEncoded(this IHtmlContentBuilder builder, string encoded)
|
public static IHtmlContentBuilder AppendHtmlLine(this IHtmlContentBuilder builder, string encoded)
|
||||||
{
|
{
|
||||||
builder.AppendEncoded(encoded);
|
builder.AppendHtml(encoded);
|
||||||
builder.Append(HtmlEncodedString.NewLine);
|
builder.Append(HtmlEncodedString.NewLine);
|
||||||
return builder;
|
return builder;
|
||||||
}
|
}
|
||||||
|
|
@ -180,7 +180,7 @@ namespace Microsoft.AspNet.Html.Abstractions
|
||||||
public static IHtmlContentBuilder SetContentEncoded(this IHtmlContentBuilder builder, string encoded)
|
public static IHtmlContentBuilder SetContentEncoded(this IHtmlContentBuilder builder, string encoded)
|
||||||
{
|
{
|
||||||
builder.Clear();
|
builder.Clear();
|
||||||
builder.AppendEncoded(encoded);
|
builder.AppendHtml(encoded);
|
||||||
return builder;
|
return builder;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -29,7 +29,7 @@ namespace Microsoft.AspNet.Html.Abstractions
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="encoded">The HTML encoded <see cref="string"/> to append.</param>
|
/// <param name="encoded">The HTML encoded <see cref="string"/> to append.</param>
|
||||||
/// <returns>The <see cref="IHtmlContentBuilder"/>.</returns>
|
/// <returns>The <see cref="IHtmlContentBuilder"/>.</returns>
|
||||||
IHtmlContentBuilder AppendEncoded(string encoded);
|
IHtmlContentBuilder AppendHtml(string encoded);
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Clears the content.
|
/// Clears the content.
|
||||||
|
|
|
||||||
|
|
@ -48,7 +48,7 @@ namespace Microsoft.Extensions.Internal
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="value">The HTML encoded <c>string</c> to be appended.</param>
|
/// <param name="value">The HTML encoded <c>string</c> to be appended.</param>
|
||||||
/// <returns>A reference to this instance after the Append operation has completed.</returns>
|
/// <returns>A reference to this instance after the Append operation has completed.</returns>
|
||||||
public IHtmlContentBuilder AppendEncoded(string value)
|
public IHtmlContentBuilder AppendHtml(string value)
|
||||||
{
|
{
|
||||||
Entries.Add(new HtmlEncodedString(value));
|
Entries.Add(new HtmlEncodedString(value));
|
||||||
return this;
|
return this;
|
||||||
|
|
|
||||||
|
|
@ -62,13 +62,13 @@ namespace Microsoft.AspNet.Html.Abstractions.Test
|
||||||
}
|
}
|
||||||
|
|
||||||
[Fact]
|
[Fact]
|
||||||
public void Builder_AppendLineEncoded_String()
|
public void Builder_AppendHtmlLine_String()
|
||||||
{
|
{
|
||||||
// Arrange
|
// Arrange
|
||||||
var builder = new TestHtmlContentBuilder();
|
var builder = new TestHtmlContentBuilder();
|
||||||
|
|
||||||
// Act
|
// Act
|
||||||
builder.AppendLineEncoded("Hi");
|
builder.AppendHtmlLine("Hi");
|
||||||
|
|
||||||
// Assert
|
// Assert
|
||||||
Assert.Collection(
|
Assert.Collection(
|
||||||
|
|
@ -366,7 +366,7 @@ namespace Microsoft.AspNet.Html.Abstractions.Test
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
public IHtmlContentBuilder AppendEncoded(string encoded)
|
public IHtmlContentBuilder AppendHtml(string encoded)
|
||||||
{
|
{
|
||||||
Entries.Add(new EncodedString(encoded));
|
Entries.Add(new EncodedString(encoded));
|
||||||
return this;
|
return this;
|
||||||
|
|
|
||||||
|
|
@ -41,11 +41,11 @@ namespace Microsoft.Extensions.Internal
|
||||||
}
|
}
|
||||||
|
|
||||||
[Fact]
|
[Fact]
|
||||||
public void AppendEncoded_DoesNotGetWrittenAsEncoded()
|
public void AppendHtml_DoesNotGetWrittenAsEncoded()
|
||||||
{
|
{
|
||||||
// Arrange
|
// Arrange
|
||||||
var content = new BufferedHtmlContent();
|
var content = new BufferedHtmlContent();
|
||||||
content.AppendEncoded("Hello");
|
content.AppendHtml("Hello");
|
||||||
|
|
||||||
var writer = new StringWriter();
|
var writer = new StringWriter();
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue