mirror of
https://github.com/khoj-ai/khoj.git
synced 2024-11-27 17:35:07 +01:00
Fix markdownRenderer arg to allow chat responses in Obsidian plugin
- Issue: Users with Dataview plugin would have error as its markdown post-processor expects the sourcePath to be a string This prevents Khoj from responding to chat messages in the Obsidian chat modal. Search via Obsidian still works but it throws the same dataview error - Fix: Pass a string as sourcePath to markdownRenderer to fix failing chat response Resolves #614, Resolves #606
This commit is contained in:
parent
08012c71b1
commit
1a46734485
2 changed files with 3 additions and 3 deletions
|
@ -182,7 +182,7 @@ export class KhojChatModal extends Modal {
|
||||||
chat_message_body_text_el.innerHTML = message;
|
chat_message_body_text_el.innerHTML = message;
|
||||||
} else {
|
} else {
|
||||||
// @ts-ignore
|
// @ts-ignore
|
||||||
MarkdownRenderer.renderMarkdown(message, chat_message_body_text_el, null, null);
|
MarkdownRenderer.renderMarkdown(message, chat_message_body_text_el, '', null);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Remove user-select: none property to make text selectable
|
// Remove user-select: none property to make text selectable
|
||||||
|
@ -221,7 +221,7 @@ export class KhojChatModal extends Modal {
|
||||||
this.result += additionalMessage;
|
this.result += additionalMessage;
|
||||||
htmlElement.innerHTML = "";
|
htmlElement.innerHTML = "";
|
||||||
// @ts-ignore
|
// @ts-ignore
|
||||||
await MarkdownRenderer.renderMarkdown(this.result, htmlElement, null, null);
|
await MarkdownRenderer.renderMarkdown(this.result, htmlElement, '', null);
|
||||||
// Scroll to bottom of modal, till the send message input box
|
// Scroll to bottom of modal, till the send message input box
|
||||||
this.modalEl.scrollTop = this.modalEl.scrollHeight;
|
this.modalEl.scrollTop = this.modalEl.scrollHeight;
|
||||||
}
|
}
|
||||||
|
|
|
@ -124,7 +124,7 @@ export class KhojSearchModal extends SuggestModal<SearchResult> {
|
||||||
let result_el = el.createEl("div", { cls: 'khoj-result-entry' })
|
let result_el = el.createEl("div", { cls: 'khoj-result-entry' })
|
||||||
|
|
||||||
// @ts-ignore
|
// @ts-ignore
|
||||||
MarkdownRenderer.renderMarkdown(snipped_entry + entry_snipped_indicator, result_el, null, null);
|
MarkdownRenderer.renderMarkdown(snipped_entry + entry_snipped_indicator, result_el, result.file, null);
|
||||||
}
|
}
|
||||||
|
|
||||||
async onChooseSuggestion(result: SearchResult, _: MouseEvent | KeyboardEvent) {
|
async onChooseSuggestion(result: SearchResult, _: MouseEvent | KeyboardEvent) {
|
||||||
|
|
Loading…
Reference in a new issue