Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Broken Staticman PR body display #148

Closed
VincentTam opened this issue Jul 13, 2019 · 1 comment
Closed

Broken Staticman PR body display #148

VincentTam opened this issue Jul 13, 2019 · 1 comment
Assignees
Labels

Comments

@VincentTam
Copy link

In each PR created by Staticman, 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

@EdwinWenink EdwinWenink self-assigned this Jul 15, 2019
@EdwinWenink
Copy link
Owner

Hi Vincent,

Very helpful, thank you! I'm currently on holiday but will look at this when I have time. Also thank you for your helpful comment on my blog! I'm curious how you found me on the web.

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

No branches or pull requests

2 participants