mirror of
https://github.com/OrchardCMS/Orchard.git
synced 2026-02-09 09:16:41 +08:00
[Fixes #5492] Adding JavaScriptEncode token
This commit is contained in:
@@ -17,6 +17,7 @@ namespace Orchard.Tokens.Providers {
|
|||||||
.Token("TrimEnd:*", T("TrimEnd:<chars|number>"), T("Trims the specified characters or number of them from the end of the string."))
|
.Token("TrimEnd:*", T("TrimEnd:<chars|number>"), T("Trims the specified characters or number of them from the end of the string."))
|
||||||
.Token("UrlEncode", T("Url Encode"), T("Encodes a URL string."), "Text")
|
.Token("UrlEncode", T("Url Encode"), T("Encodes a URL string."), "Text")
|
||||||
.Token("HtmlEncode", T("Html Encode"), T("Encodes an HTML string."), "Text")
|
.Token("HtmlEncode", T("Html Encode"), T("Encodes an HTML string."), "Text")
|
||||||
|
.Token("JavaScriptEncode", T("JavaScript Encode"), T("Encodes a JavaScript string."), "Text")
|
||||||
.Token("LineEncode", T("Line Encode"), T("Replaces new lines with <br /> tags."), "Text")
|
.Token("LineEncode", T("Line Encode"), T("Replaces new lines with <br /> tags."), "Text")
|
||||||
;
|
;
|
||||||
}
|
}
|
||||||
@@ -41,6 +42,8 @@ namespace Orchard.Tokens.Providers {
|
|||||||
.Chain("UrlEncode", "Text", HttpUtility.UrlEncode)
|
.Chain("UrlEncode", "Text", HttpUtility.UrlEncode)
|
||||||
.Token("HtmlEncode", HttpUtility.HtmlEncode)
|
.Token("HtmlEncode", HttpUtility.HtmlEncode)
|
||||||
.Chain("HtmlEncode", "Text", HttpUtility.HtmlEncode)
|
.Chain("HtmlEncode", "Text", HttpUtility.HtmlEncode)
|
||||||
|
.Token("JavaScriptEncode", HttpUtility.JavaScriptStringEncode)
|
||||||
|
.Chain("JavaScriptEncode", "Text", HttpUtility.JavaScriptStringEncode)
|
||||||
.Token("LineEncode", text => text.Replace(System.Environment.NewLine, "<br />"))
|
.Token("LineEncode", text => text.Replace(System.Environment.NewLine, "<br />"))
|
||||||
.Chain("LineEncode", "Text", text => text.Replace(System.Environment.NewLine, "<br />"))
|
.Chain("LineEncode", "Text", text => text.Replace(System.Environment.NewLine, "<br />"))
|
||||||
;
|
;
|
||||||
|
|||||||
Reference in New Issue
Block a user