Closed simonw closed 3 months ago
Ideally Datasette would make the primary key available in a data-
attribute, maybe on the <tr>
for the row.
Temporary fix is to strip anything in a <span>
before trying to read the primary key.
let copy = td.cloneNode(true)
Array.from(copy.querySelectorAll('span')).forEach(span => span.parentNode.removeChild(span));
let pk = copy.textContent;
Because of this code: https://github.com/datasette/datasette-checkbox/blob/c028ac7197c77393166e4bec9fb6e74cb808ede9/datasette_checkbox/__init__.py#L42-L43
Those plugins add extra stuff to that
<td>
which interferes there.