From 3f24e53b6e2fd60f88e7988bea3ee5a080cfe206 Mon Sep 17 00:00:00 2001 From: Debanjum Singh Solanky Date: Sat, 17 Jun 2023 04:26:40 -0700 Subject: [PATCH] Render URL as link in web interface if file param of result is a web link --- src/khoj/interface/web/index.html | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/khoj/interface/web/index.html b/src/khoj/interface/web/index.html index 388c0207..d9874072 100644 --- a/src/khoj/interface/web/index.html +++ b/src/khoj/interface/web/index.html @@ -34,6 +34,9 @@ function render_markdown(query, data) { var md = window.markdownit(); return md.render(data.map(function (item) { + lines = item.entry.split("\n") + if (item.additional.file.startsWith("http")) + return `${lines[0]}\t[*](${item.additional.file})\n${lines.slice(1).join("\n")}` return `${item.entry}` }).join("\n")); }