From e756e160d7c43eb775e242b766ad13cb6f68e913 Mon Sep 17 00:00:00 2001 From: Adam French Date: Mon, 12 Jan 2026 16:41:40 +0000 Subject: [PATCH] fix links --- nginx/vue/src/views/Notes.vue | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/nginx/vue/src/views/Notes.vue b/nginx/vue/src/views/Notes.vue index d3528b4..863b378 100644 --- a/nginx/vue/src/views/Notes.vue +++ b/nginx/vue/src/views/Notes.vue @@ -5,10 +5,17 @@ import axios from "axios"; const note = ref(null); -const fetchNote = async () => { +function fixContents(contents) { + // Obsidian notes have links in the form [[link|name]] + // contents so that they are rendered correctly + return contents.replace(/\[\[(.*?)\|(.*)\]\]/g, '$2'); +} + +async function fetchNote() { const response = await axios.get("/api/notes/Index"); + response.data.contents = fixContents(response.data.contents); note.value = response.data; -}; +} onMounted(fetchNote);