Build your personal knowledge base with Trilium Notes
TypeScript electronelectron-appknowledge-baseknowledge-graphknowledge-managementknowledge-management-graphlocal-firstnote-managmentnote-takernote-takingnotebooknotesnotes-apppersonal-knowledge-basepersonal-wikiscriptableself-hostedself-hostingwiki
parsing links in html to keep references between notes in links table
azivnera36282caf044
diff --git a/static/js/html2notecase.js b/static/js/html2notecase.jsindex 54ec2b2dd1..0b4ee7375f 100644--- a/static/js/html2notecase.js+++ b/static/js/html2notecase.js@@ -8,6 +8,20 @@ function html2notecase(contents, note) {if (globalHtmlEnabled) {note.detail.note_text = contents;+ if (!note.detail.encryption) {+ const linkRegexp = /<a[^>]+?href="[^"]*kapp#([A-Za-z0-9]{22})"[^>]*?>[^<]+?<\/a>/g;+ let match;++ while (match = linkRegexp.exec(contents)) {+ console.log("adding link for " + match[1]);++ note.links.push({+ note_id: note.detail.note_id,+ target_note_id: match[1]+ });+ }+ }+return;}