Skip to content
This repository has been archived by the owner on Oct 7, 2024. It is now read-only.

Broken Staticman PR body display #223

Open
VincentTam opened this issue Jul 7, 2019 · 0 comments
Open

Broken Staticman PR body display #223

VincentTam opened this issue Jul 7, 2019 · 0 comments

Comments

@VincentTam
Copy link

VincentTam commented Jul 7, 2019

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

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant