Skip to content

Commit 6bfeed7

Browse files
Bold Create AgentVinothSF5015
andcommitted
Restore citation place formatting so answers render completely
Co-authored-by: VinothSF5015 <197725877+VinothSF5015@users.noreply.github.com>
1 parent 6786c12 commit 6bfeed7

1 file changed

Lines changed: 14 additions & 0 deletions

File tree

  • Document-Chunking/AgentRAGWithAzure 1/AgentRAGWithAzure/wwwroot/js

‎Document-Chunking/AgentRAGWithAzure 1/AgentRAGWithAzure/wwwroot/js/workspace.js‎

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -340,6 +340,20 @@ function renderMarkdown(src) {
340340
return '<div class="answer">' + (html || "<p></p>") + "</div>";
341341
}
342342

343+
function formatCitationPlace(citation) {
344+
if (!citation) return "";
345+
if (citation.pageNumber) return "Page " + citation.pageNumber;
346+
if (citation.sheetName || citation.cellAddress) {
347+
if (citation.sheetName && citation.cellAddress) return citation.sheetName + "!" + citation.cellAddress;
348+
return citation.sheetName || citation.cellAddress || "";
349+
}
350+
if (citation.headingPath) return citation.headingPath;
351+
if (citation.citationDisplay && citation.sourceName && citation.citationDisplay !== citation.sourceName) {
352+
return citation.citationDisplay;
353+
}
354+
return "";
355+
}
356+
343357
function addMessage(text, sender, citations, noSource) {
344358
dismissWelcome();
345359
const chatWindow = document.getElementById("chatWindow");

0 commit comments

Comments
 (0)