mirror of
https://github.com/hkalexling/Mango.git
synced 2025-08-03 03:15:31 -04:00
Gracefully handle nullish fields
This commit is contained in:
parent
2007f13ed6
commit
b2329a79b4
@ -70,7 +70,7 @@ const buildTable = (chapters) => {
|
|||||||
const rows = chapters.map(ch => {
|
const rows = chapters.map(ch => {
|
||||||
const tds = Object.values(ch).map(v => {
|
const tds = Object.values(ch).map(v => {
|
||||||
const maxLength = 40;
|
const maxLength = 40;
|
||||||
const shouldShrink = v.length > maxLength;
|
const shouldShrink = v && v.length > maxLength;
|
||||||
const content = shouldShrink ? `<span title="${v}">${v.substring(0, maxLength)}...</span><div uk-dropdown><span>${v}</span></div>` : v;
|
const content = shouldShrink ? `<span title="${v}">${v.substring(0, maxLength)}...</span><div uk-dropdown><span>${v}</span></div>` : v;
|
||||||
return `<td>${content}</td>`
|
return `<td>${content}</td>`
|
||||||
}).join('');
|
}).join('');
|
||||||
|
Loading…
x
Reference in New Issue
Block a user