class Crinja::Config::Autoescape
- Crinja::Config::Autoescape
- Reference
- Object
Overview
This class holds configuration values for autoescape config.
It accepts the same settings as [select_autoescape](http://jinja.pocoo.org/docs/2.9/api/#jinja2.select_autoescape)
in Jinja 2.9.
It intelligently sets the initial value of autoescaping based on the filename of the template.
Defined in:
config.crConstant Summary
-
DISABLED =
Autoescape.new(enabled_extensions: [] of String, default_for_string: false, default: false)
-
Configuration settings where autoescape is deactivated by default for any kind of template.
-
ENABLED =
Autoescape.new(disabled_extensions: [] of String, default_for_string: true, default: true)
-
Configuration settings where autoescape is activated by default for any kind of template.
Constructors
-
.new(enabled_extensions = ["html", "htm", "xml"], disabled_extensions = [] of String, default_for_string : Bool = false, default : Bool = false)
Initializes the default autoescape configuration.
Instance Method Summary
-
#autoescape?(filename : String? = nil)
Determines if a template with filename should have autoescape enabled or not.
-
#default : Bool
If nothing matches, this will be the default autoescape value.
-
#default=(default : Bool)
If nothing matches, this will be the default autoescape value.
-
#default_for_string : Bool
Determines autoescape default value for templates loaded from a string (without a filename).
-
#default_for_string=(default_for_string : Bool)
Determines autoescape default value for templates loaded from a string (without a filename).
-
#disabled_extensions : Array(String)
List of filename extensions that autoescape should be disabled for.
- #disabled_extensions=(extensions : Array(String))
-
#enabled_extensions : Array(String)
List of filename extensions that autoescape should be enabled for.
- #enabled_extensions=(extensions : Array(String))
Constructor Detail
Initializes the default autoescape configuration.
Instance Method Detail
Determines if a template with filename should have autoescape enabled or not.
Determines autoescape default value for templates loaded from a string (without a filename).
Determines autoescape default value for templates loaded from a string (without a filename).
List of filename extensions that autoescape should be disabled for.
List of filename extensions that autoescape should be enabled for.