Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion context.go
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ func newExecutionContext(tpl *Template, ctx Context) *ExecutionContext {

Public: ctx,
Private: privateCtx,
Autoescape: autoescape,
Autoescape: tpl.Options.AutoEscape,
}
}

Expand Down
3 changes: 3 additions & 0 deletions options.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,19 +8,22 @@ type Options struct {

// If this is set to true leading spaces and tabs are stripped from the start of a line to a block. Defaults to false
LStripBlocks bool
AutoEscape bool
}

func newOptions() *Options {
return &Options{
TrimBlocks: false,
LStripBlocks: false,
AutoEscape: true,
}
}

// Update updates this options from another options.
func (opt *Options) Update(other *Options) *Options {
opt.TrimBlocks = other.TrimBlocks
opt.LStripBlocks = other.LStripBlocks
opt.AutoEscape = other.AutoEscape

return opt
}