Keep a template's table in one field, tableSite

This commit is contained in:
2026-09-29 03:30:19 +02:00
committed by Lillem4n
parent 05bc56fe75
commit e9cdfe9edd
9 changed files with 34 additions and 36 deletions
+2 -2
View File
@@ -308,7 +308,7 @@ func (t *table) checkCells() error {
if strings.IndexByte(cell, '{') < 0 && strings.IndexByte(cell, '}') < 0 {
continue
}
n, err := compileString(cell, cellSite{t, row})
n, err := compileString(cell, tableSite{t, row})
if err != nil {
return fmt.Errorf("line %d, %s: %w", row+2, t.header[col], err)
}
@@ -341,7 +341,7 @@ func (t *table) compileRowFormat(format string) error {
if err := checkTokens(toks, t.fields); err != nil {
return err
}
t.formatTemplate = &template{format: format, tokens: toks, fields: t.fields, repeat: 1, isRecord: true, table: t}
t.formatTemplate = &template{format: format, tokens: toks, fields: t.fields, repeat: 1, isRecord: true, site: tableSite{t, formatRow}}
t.pinnedRow = &tableRow{t}
return nil
}