Open klundberg opened 7 years ago
I can confirm this.
But it can be solved easily, when generating a table: https://github.com/eduardoboucas/staticman/blob/ecf03862a0164e5d0b2575e2bf926a41bf034c84/lib/Staticman.js#L201-L203
Just remove new lines and replace them with breaks <br />
.
Object.keys(fields).forEach(field => {
table.push([field, fields[field].replace(/\n/gm, '<br />')])
})
Afaik this is the only way to add newlines to a markdown table.
~I will do a PR for this soon.~ EDIT: This is a one line fix, but I'm not sure how to test it before making a PR :/
Bump, any news on this one?
Just got two comments with the same issue, and each of them renders differently. One looks exactly same like the PR in @klundberg 's repo. And the other look like this:
Furthermore, I don't understand where the fields tags
and layout
came from. I've never configured them in allowedFields
in staticman.yml
.
@JokerQyou The code is only replacing LF, but I suspect your example had CR/LF. In PR #289 I chained two calls to replace to handle both scenarios.
@BloggerBust-bot Your PR contains an unnecessary dependence on #285, so I created another one for the convenience of v3 users. Anyways, great work!
I just got this PR from staticman: https://github.com/klundberg/klundberg.github.io/pull/4