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

'; }