diff --git a/document.go b/document.go index 06f0dad..f70ed96 100644 --- a/document.go +++ b/document.go @@ -29,6 +29,8 @@ func (this *Document) Execute (output io.Writer, data ExecutionData) error { // execute into string builder outputBuilder := strings.Builder { } + // TODO catch template errors here and offset their row number by the + // number of rows taken up by the front matter err := this.template.Execute(&outputBuilder, data) if err != nil { return err } diff --git a/environment.go b/environment.go index fcdf128..a78cd7f 100644 --- a/environment.go +++ b/environment.go @@ -109,6 +109,8 @@ func (this *Environment) parse (name string, modTime time.Time, input io.Reader) // parse template from the body document.template.Funcs(this.funcMap) + // TODO catch template errors here and offset their row number by the + // number of rows taken up by the front matter _, err = document.template.Parse(body) if err != nil { return nil, err }