From 6e58d0bf1d25f958fb11c62196a6a1dbbec7f001 Mon Sep 17 00:00:00 2001 From: Saifeddine ALOUI Date: Fri, 24 Jan 2025 17:08:33 +0100 Subject: [PATCH] Update index.html --- lightrag/api/static/index.html | 63 ++++++++++++++++++++++++++++++++-- 1 file changed, 60 insertions(+), 3 deletions(-) diff --git a/lightrag/api/static/index.html b/lightrag/api/static/index.html index 2a0dee71..04bdd84c 100644 --- a/lightrag/api/static/index.html +++ b/lightrag/api/static/index.html @@ -7,6 +7,11 @@ + + + + + -
+
@@ -384,12 +431,22 @@ // Format and display the response if (data.response) { - // Use marked.js to render markdown + const formattedResponse = marked.parse(data.response, { + highlight: function(code, lang) { + if (Prism.languages[lang]) { + return Prism.highlight(code, Prism.languages[lang], lang); + } + return code; + } + }); queryResponse.innerHTML = `
- ${marked.parse(data.response)} + ${formattedResponse}
`; + + // Re-trigger Prism highlighting + Prism.highlightAllUnder(queryResponse); } else { queryResponse.innerHTML = '

No response data received

'; }