diff --git a/blocks/table/table.js b/blocks/table/table.js index 58fa33f..eb88936 100644 --- a/blocks/table/table.js +++ b/blocks/table/table.js @@ -131,13 +131,11 @@ export default async function decorate(block) { const cells = [...row.querySelectorAll(':scope > div')]; const tr = html` - ${cells.map((cell) => { - decoratePills(cell); - return ``; - }).join('\n') -} + ${cells.map((cell) => ``).join('\n')}
${cell.innerHTML}${cell.innerHTML}
`.firstElementChild.firstElementChild; tbody.appendChild(tr); }); + + decoratePills(table); } diff --git a/scripts/scripts.js b/scripts/scripts.js index 605a9a9..4110864 100644 --- a/scripts/scripts.js +++ b/scripts/scripts.js @@ -801,9 +801,15 @@ export function decoratePill(p) { nodes.push(text); } - const parent = p.parentElement; - p.remove(); - parent.append(...nodes); + if (p.tagName === 'p') { + const parent = p.parentElement; + p.remove(); + parent.append(...nodes); + } else { + // td + p.innerHTML = ''; + p.append(...nodes); + } } export function decoratePills(main) {