Allow to fetch recursive metadata from pages in tables
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
Peter Stuifzand 2021-08-08 23:44:36 +02:00
parent 6c260e654d
commit 27200abc58

View File

@ -274,11 +274,15 @@ function Editor(holder, input) {
el("td", [renderInline(rowText)]),
..._.map(header.children, col => {
let td = el("td")
let value = rowData[_.snakeCase(_.trim(col.text))];
let key = _.trim(col.text);
let value = _.get(rowData, key)
if (_.isObject(value) && value.line) {
value = value.line
}
if (col.children && col.children.length > 0) {
value = col.children[0].text
}
transform(value ? value.replace(/^:/, '=') : '', $(td), id, editor, rowData)
transform(typeof value === 'string' ? value.replace(/^:/, '=') : '', $(td), id, editor, rowData)
return td
})
])