Add some TODOs

This commit is contained in:
Sasha Koshka 2024-12-07 03:13:58 -05:00
parent 006a311aeb
commit a2edaf30e1
2 changed files with 4 additions and 0 deletions

View File

@ -29,6 +29,8 @@ func (this *Document) Execute (output io.Writer, data ExecutionData) error {
// execute into string builder // execute into string builder
outputBuilder := strings.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) err := this.template.Execute(&outputBuilder, data)
if err != nil { return err } if err != nil { return err }

View File

@ -109,6 +109,8 @@ func (this *Environment) parse (name string, modTime time.Time, input io.Reader)
// parse template from the body // parse template from the body
document.template.Funcs(this.funcMap) 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) _, err = document.template.Parse(body)
if err != nil { return nil, err } if err != nil { return nil, err }