diff --git a/src/khoj/configure.py b/src/khoj/configure.py
index 4cfe45d6..c6c9e308 100644
--- a/src/khoj/configure.py
+++ b/src/khoj/configure.py
@@ -219,7 +219,7 @@ def save_chat_session():
conversation_logfile = resolve_absolute_path(state.processor_config.conversation.conversation_logfile)
conversation_logfile.parent.mkdir(parents=True, exist_ok=True) # create conversation directory if doesn't exist
with open(conversation_logfile, "w+", encoding="utf-8") as logfile:
- json.dump(conversation_log, logfile)
+ json.dump(conversation_log, logfile, indent=2)
state.processor_config.conversation.chat_session = None
logger.info("📩 Saved current chat session to conversation logs")
diff --git a/src/khoj/interface/web/chat.html b/src/khoj/interface/web/chat.html
index 3bd46109..00056a44 100644
--- a/src/khoj/interface/web/chat.html
+++ b/src/khoj/interface/web/chat.html
@@ -18,7 +18,8 @@
function generateReference(reference, index) {
// Generate HTML for Chat Reference
- return `${index}`;
+ let escaped_ref = reference.replaceAll("\"", "\\\"")
+ return `${index}`;
}
function renderMessage(message, by, dt=null) {
@@ -179,6 +180,7 @@
color: #f8fafc;
background: #017eff;
margin-left: auto;
+ white-space: pre-line;
}
/* add left protrusion to khoj chat bubble */
.chat-message-text.khoj:after {