fix rendering templates created from string literals

This commit is contained in:
Ilya Puchka
2017-12-26 21:20:09 +01:00
parent ed885f462a
commit abeb30bb1c
2 changed files with 3 additions and 1 deletions

View File

@@ -43,6 +43,8 @@ public struct Environment {
}
func render(template: Template, context: [String: Any]?) throws -> String {
// update temaplte environment as it cen be created from string literal with default environment
template.environment = self
errorReporter.context = ErrorReporterContext(template: template)
do {
return try template.render(context)