mirror of
https://github.com/OrchardCMS/Orchard.git
synced 2026-02-09 09:16:41 +08:00
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.
28 lines
783 B
C#
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 };
|
|
}
|
|
}
|
|
|
|
}
|
|
} |