okfde/offenerhaushalt.de

Broken Staticman PR body display

VincentTam opened this issue · 0 comments

In each PR titled "New budget", the table isn't correctly rendered. The culprit of this error is the \n in the cell. (c.f. eduardoboucas/staticman#90) This can be fixed by eduardoboucas/staticman#301, which replaces the line

table.push([field, fields[field]])

with

let field_value = fields[field]
field_value = typeof field_value === 'string' ? field_value.replace(/\r\n/g,'<br>') : field_value
table.push([field, field_value])

Here's a working example on GitLab, served by my bot @staticmanlab, which has incorporated the above PR: https://gitlab.com/pcercuei/pcercuei.gitlab.io/merge_requests/146