table
table copied to clipboard
Links are not parsed
Hi, When using an URL in a text of a column, it is not parsed correctly. Just see as a result a plain string of text.
document.addEventListener("DOMContentLoaded", function() {
const table = document.getElementById("data-table");
function parseUrls(text) {
const urlPattern = /(https?:\/\/[^\s]+)/g;
return text.replace(urlPattern, '<a href="$1" target="_blank">$1</a>');
}
for (let row of table.rows) {
for (let cell of row.cells) {
cell.innerHTML = parseUrls(cell.innerHTML);
}
}
});