fix: correctly display filename in db list by splitting on backslash

This commit is contained in:
lx1056758714-glitch
2025-12-26 14:40:40 +08:00
parent 9c88f1184a
commit f5e1bc54e9

View File

@@ -527,7 +527,7 @@
// Escape backslashes for JS string
const escapedFile = file.replace(/\\/g, '\\\\');
html += `<div class="db-item" onclick="openDBViewer('${group}', '${escapedFile}')">
<span style="font-weight:bold;">📄 ${file.split(/[\/]/).pop()}</span>
<span style="font-weight:bold;">📄 ${file.split(/[\\/]/).pop()}</span>
<span class="text-gray text-sm" style="margin-left:auto;">${file}</span>
</div>`;
});