-
Notifications
You must be signed in to change notification settings - Fork 543
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
Multiline field markdowntable #289
base: master
Are you sure you want to change the base?
Multiline field markdowntable #289
Conversation
This reverts commit d800786.
Now the commit message will not break up multi-line field values into multiple fields without values.
To handle both CR\LF and LF line endings I have chained two global replace calls.
Thanks for PR, even though I don't think this will be merged due to its dependence on #285. Actually, the part that actually does the job is Object.keys(fields).forEach(field => {
let fieldValue = fields[field]
fieldValue = typeof fieldValue === 'string' ? fieldValue.replace(/\r\n/g, '<br>').replace(/\n/g, '<br>') : fieldValue
table.push([field, fieldValue])
}) https://github.com/eduardoboucas/staticman/pull/289/files#diff-0eb30e85bf25fbc952a68845f6e23860 It is possible that a Staticman v3 user implement this part only without change the rest of the code? |
Implements first three commits of eduardoboucas#289
Update: I've tested the above code block without the rollback. It works light and right. Bravo ! Here's an example on GitLab. |
I am glad to hear that you were able to get the fix working :-) |
Should I close PR #285? It doesn't seem that it is needed. When I created it, the master branch was broken and that was my way of getting things working again.
It looks like you were able to get it working with v3. That is fabulous! |
I can't give a yes/no answer since I haven't tested that. Based on my testing, it seems that #231 doesn't work well with 4eb5ce2, which is included in your PR. I've chosen #231 since that's a continuation of Staticman's GitLab support, which is in fact my main goal of setting up another API instance, as the name "Staticman Lab" suggests. However, it doesn't hurt leaving it there, judging from the feedback from other users in #283.
My instances are using the v3 URL scheme, but I'm not merging recent commits on the branches |
Depends on: #285
By replacing line-endings found within a field value with an HTML break element, the field value will render with multiple lines in a single table cell, rather than being broken up into multiple table rows.
The only difference between this PR and #285 is in Staticman.js on lines 280 to 282