React to WebEncoders being moved to their own package

This commit is contained in:
Levi B 2015-02-23 14:40:56 -08:00
parent 3dbdf3b2d6
commit 36c5efd0e2
3 changed files with 12 additions and 12 deletions

View File

@ -2,8 +2,8 @@
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. // Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
using System.Collections.Generic; using System.Collections.Generic;
using System.Text; using System.IO;
using Microsoft.AspNet.WebUtilities.Encoders; using Microsoft.Framework.WebEncoders;
namespace Microsoft.AspNet.Mvc.TagHelpers.Internal namespace Microsoft.AspNet.Mvc.TagHelpers.Internal
{ {
@ -17,27 +17,27 @@ namespace Microsoft.AspNet.Mvc.TagHelpers.Internal
/// </summary> /// </summary>
public static string Encode(IJavaScriptStringEncoder encoder, IEnumerable<string> values) public static string Encode(IJavaScriptStringEncoder encoder, IEnumerable<string> values)
{ {
var builder = new StringBuilder(); var writer = new StringWriter();
var firstAdded = false; var firstAdded = false;
builder.Append('['); writer.Write('[');
foreach (var value in values) foreach (var value in values)
{ {
if (firstAdded) if (firstAdded)
{ {
builder.Append(','); writer.Write(',');
} }
builder.Append('"'); writer.Write('"');
builder.Append(encoder.JavaScriptStringEncode(value)); encoder.JavaScriptStringEncode(value, writer);
builder.Append('"'); writer.Write('"');
firstAdded = true; firstAdded = true;
} }
builder.Append(']'); writer.Write(']');
return builder.ToString(); return writer.ToString();
} }
} }
} }

View File

@ -10,9 +10,9 @@ using System.Text;
using Microsoft.AspNet.Hosting; using Microsoft.AspNet.Hosting;
using Microsoft.AspNet.Mvc.TagHelpers.Internal; using Microsoft.AspNet.Mvc.TagHelpers.Internal;
using Microsoft.AspNet.Razor.Runtime.TagHelpers; using Microsoft.AspNet.Razor.Runtime.TagHelpers;
using Microsoft.AspNet.WebUtilities.Encoders;
using Microsoft.Framework.Cache.Memory; using Microsoft.Framework.Cache.Memory;
using Microsoft.Framework.Logging; using Microsoft.Framework.Logging;
using Microsoft.Framework.WebEncoders;
namespace Microsoft.AspNet.Mvc.TagHelpers namespace Microsoft.AspNet.Mvc.TagHelpers
{ {

View File

@ -8,8 +8,8 @@ using System.Text;
using System.Threading.Tasks; using System.Threading.Tasks;
using Microsoft.AspNet.Mvc.TagHelpers.Internal; using Microsoft.AspNet.Mvc.TagHelpers.Internal;
using Microsoft.AspNet.Razor.Runtime.TagHelpers; using Microsoft.AspNet.Razor.Runtime.TagHelpers;
using Microsoft.AspNet.WebUtilities.Encoders;
using Microsoft.Framework.Logging; using Microsoft.Framework.Logging;
using Microsoft.Framework.WebEncoders;
namespace Microsoft.AspNet.Mvc.TagHelpers namespace Microsoft.AspNet.Mvc.TagHelpers
{ {