mirror of
https://github.com/khoj-ai/khoj.git
synced 2024-11-27 17:35:07 +01:00
Render URL as link in web interface if file param of result is a web link
This commit is contained in:
parent
63ec84ad78
commit
3f24e53b6e
1 changed files with 3 additions and 0 deletions
|
@ -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"));
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue