mirror of
https://github.com/khoaliber/khoj.git
synced 2026-03-04 05:39:06 +00:00
Merge branch 'master' of github.com:debanjum/khoj into features/pretty-config-page
This commit is contained in:
@@ -33,7 +33,11 @@
|
||||
function render_markdown(query, data) {
|
||||
var md = window.markdownit();
|
||||
return md.render(data.map(function (item) {
|
||||
return `${item.entry}`
|
||||
if (item.additional.file.startsWith("http")) {
|
||||
lines = item.entry.split("\n");
|
||||
return `${lines[0]}\t[*](${item.additional.file})\n${lines.slice(1).join("\n")}`;
|
||||
}
|
||||
return `${item.entry}`;
|
||||
}).join("\n"));
|
||||
}
|
||||
|
||||
@@ -65,6 +69,8 @@
|
||||
return render_ledger(query, data);
|
||||
} else if (type === "pdf") {
|
||||
return render_pdf(query, data);
|
||||
} else if (type == "github") {
|
||||
return render_markdown(query, data);
|
||||
} else {
|
||||
return `<div id="results-plugin">`
|
||||
+ data.map((item) => `<p>${item.entry}</p>`).join("\n")
|
||||
@@ -295,7 +301,7 @@
|
||||
text-align: left;
|
||||
white-space: pre-line;
|
||||
}
|
||||
#results-markdown {
|
||||
#results-markdown, #results-github {
|
||||
text-align: left;
|
||||
}
|
||||
#results-music,
|
||||
|
||||
Reference in New Issue
Block a user