Files
Orchard/src/Orchard.Web/Modules/Orchard.Tokens/ReplaceOptions.cs
Lombiq 5406b17601 Converting all files stored as CRLF in git to be stored as LF
LF is the git default and all new files are stored as such. Old files from the hg to git conversion however were moved over as CRLF.
2015-12-13 22:21:02 +01:00

28 lines
783 B
C#

using System;
using System.Web;
namespace Orchard.Tokens {
public class ReplaceOptions {
public Func<string, bool> Predicate { get; set; }
public Func<string, object, string> Encoding { get; set; }
public static string HtmlEncode(string token, object value) {
return HttpUtility.HtmlEncode(value);
}
public static string NoEncode(string token, object value) {
return Convert.ToString(value);
}
public static string UrlEncode(string token, object value) {
return HttpUtility.UrlEncode(value.ToString());
}
public static ReplaceOptions Default {
get {
return new ReplaceOptions { Encoding = HtmlEncode };
}
}
}
}