commit
b90220ad05
|
|
@ -61,17 +61,17 @@ namespace Microsoft.AspNetCore.Razor.TagHelpers
|
||||||
void Init(Microsoft.AspNetCore.Razor.TagHelpers.TagHelperContext context);
|
void Init(Microsoft.AspNetCore.Razor.TagHelpers.TagHelperContext context);
|
||||||
System.Threading.Tasks.Task ProcessAsync(Microsoft.AspNetCore.Razor.TagHelpers.TagHelperContext context, Microsoft.AspNetCore.Razor.TagHelpers.TagHelperOutput output);
|
System.Threading.Tasks.Task ProcessAsync(Microsoft.AspNetCore.Razor.TagHelpers.TagHelperContext context, Microsoft.AspNetCore.Razor.TagHelpers.TagHelperOutput output);
|
||||||
}
|
}
|
||||||
public partial class NullHtmlEncoder : System.Text.Encodings.Web.HtmlEncoder
|
public sealed partial class NullHtmlEncoder : System.Text.Encodings.Web.HtmlEncoder
|
||||||
{
|
{
|
||||||
protected NullHtmlEncoder() { }
|
internal NullHtmlEncoder() { }
|
||||||
public static new Microsoft.AspNetCore.Razor.TagHelpers.NullHtmlEncoder Default { [System.Runtime.CompilerServices.CompilerGeneratedAttribute]get { throw null; } }
|
public static new Microsoft.AspNetCore.Razor.TagHelpers.NullHtmlEncoder Default { [System.Runtime.CompilerServices.CompilerGeneratedAttribute]get { throw null; } }
|
||||||
public override int MaxOutputCharactersPerInputCharacter { get { throw null; } }
|
public override int MaxOutputCharactersPerInputCharacter { get { throw null; } }
|
||||||
public override void Encode(System.IO.TextWriter output, char[] value, int startIndex, int characterCount) { }
|
public override void Encode(System.IO.TextWriter output, char[] value, int startIndex, int characterCount) { }
|
||||||
public override void Encode(System.IO.TextWriter output, string value, int startIndex, int characterCount) { }
|
public override void Encode(System.IO.TextWriter output, string value, int startIndex, int characterCount) { }
|
||||||
public override string Encode(string value) { throw null; }
|
public override string Encode(string value) { throw null; }
|
||||||
public unsafe override int FindFirstCharacterToEncode(char* text, int textLength) { throw null; }
|
[System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.AggressiveInlining)]public unsafe override int FindFirstCharacterToEncode(char* text, int textLength) { throw null; }
|
||||||
public unsafe override bool TryEncodeUnicodeScalar(int unicodeScalar, char* buffer, int bufferLength, out int numberOfCharactersWritten) { throw null; }
|
public unsafe override bool TryEncodeUnicodeScalar(int unicodeScalar, char* buffer, int bufferLength, out int numberOfCharactersWritten) { throw null; }
|
||||||
public override bool WillEncode(int unicodeScalar) { throw null; }
|
[System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.AggressiveInlining)]public override bool WillEncode(int unicodeScalar) { throw null; }
|
||||||
}
|
}
|
||||||
[System.AttributeUsageAttribute(System.AttributeTargets.Class, AllowMultiple=false, Inherited=false)]
|
[System.AttributeUsageAttribute(System.AttributeTargets.Class, AllowMultiple=false, Inherited=false)]
|
||||||
public sealed partial class OutputElementHintAttribute : System.Attribute
|
public sealed partial class OutputElementHintAttribute : System.Attribute
|
||||||
|
|
|
||||||
|
|
@ -3,6 +3,7 @@
|
||||||
|
|
||||||
using System;
|
using System;
|
||||||
using System.IO;
|
using System.IO;
|
||||||
|
using System.Runtime.CompilerServices;
|
||||||
using System.Text.Encodings.Web;
|
using System.Text.Encodings.Web;
|
||||||
|
|
||||||
namespace Microsoft.AspNetCore.Razor.TagHelpers
|
namespace Microsoft.AspNetCore.Razor.TagHelpers
|
||||||
|
|
@ -11,12 +12,12 @@ namespace Microsoft.AspNetCore.Razor.TagHelpers
|
||||||
/// A <see cref="HtmlEncoder"/> that does not encode. Should not be used when writing directly to a response
|
/// A <see cref="HtmlEncoder"/> that does not encode. Should not be used when writing directly to a response
|
||||||
/// expected to contain valid HTML.
|
/// expected to contain valid HTML.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public class NullHtmlEncoder : HtmlEncoder
|
public sealed class NullHtmlEncoder : HtmlEncoder
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Initializes a <see cref="NullHtmlEncoder"/> instance.
|
/// Initializes a <see cref="NullHtmlEncoder"/> instance.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
protected NullHtmlEncoder()
|
private NullHtmlEncoder()
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -27,13 +28,7 @@ namespace Microsoft.AspNetCore.Razor.TagHelpers
|
||||||
public static new NullHtmlEncoder Default { get; } = new NullHtmlEncoder();
|
public static new NullHtmlEncoder Default { get; } = new NullHtmlEncoder();
|
||||||
|
|
||||||
/// <inheritdoc />
|
/// <inheritdoc />
|
||||||
public override int MaxOutputCharactersPerInputCharacter
|
public override int MaxOutputCharactersPerInputCharacter => 1;
|
||||||
{
|
|
||||||
get
|
|
||||||
{
|
|
||||||
return 1;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <inheritdoc />
|
/// <inheritdoc />
|
||||||
public override string Encode(string value)
|
public override string Encode(string value)
|
||||||
|
|
@ -67,7 +62,6 @@ namespace Microsoft.AspNetCore.Razor.TagHelpers
|
||||||
output.Write(value, startIndex, characterCount);
|
output.Write(value, startIndex, characterCount);
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <inheritdoc />
|
|
||||||
public override void Encode(TextWriter output, string value, int startIndex, int characterCount)
|
public override void Encode(TextWriter output, string value, int startIndex, int characterCount)
|
||||||
{
|
{
|
||||||
if (output == null)
|
if (output == null)
|
||||||
|
|
@ -85,10 +79,13 @@ namespace Microsoft.AspNetCore.Razor.TagHelpers
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
output.Write(value.Substring(startIndex, characterCount));
|
var span = value.AsSpan(startIndex, characterCount);
|
||||||
|
|
||||||
|
output.Write(span);
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <inheritdoc />
|
/// <inheritdoc />
|
||||||
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||||
public override unsafe int FindFirstCharacterToEncode(char* text, int textLength)
|
public override unsafe int FindFirstCharacterToEncode(char* text, int textLength)
|
||||||
{
|
{
|
||||||
return -1;
|
return -1;
|
||||||
|
|
@ -112,6 +109,7 @@ namespace Microsoft.AspNetCore.Razor.TagHelpers
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <inheritdoc />
|
/// <inheritdoc />
|
||||||
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||||
public override bool WillEncode(int unicodeScalar)
|
public override bool WillEncode(int unicodeScalar)
|
||||||
{
|
{
|
||||||
return false;
|
return false;
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue