Files
Trilium/src/main/fixactivelink.ts

11 lines
408 B
TypeScript
Raw Normal View History

2023-09-21 03:18:11 -04:00
export default function fixActiveLink() {
const active = document.querySelector("#menu strong");
if (!active) return; // Something is really wrong
const link = document.createElement("a");
link.className = "type-text active";
link.href = ``;
link.textContent = active.textContent;
active.replaceWith(link);
const id = document.body.dataset.noteId;
link.href = `./${id}`;
}