Update markdown parsing to correctly split on triple backticks, improving block extraction logic.

This commit is contained in:
tusharmagar 2025-08-15 13:47:51 +05:30
parent d0cd917d06
commit 5289bf6ced

View file

@ -9,7 +9,7 @@ const copilotCodeMarker = "copilot_change\n";
function parseMarkdown(markdown: string): Block[] {
// Split on triple backticks but keep the delimiters
// This gives us the raw content between and including delimiters
const parts = markdown.split("\n```");
const parts = markdown.split(/(?:\n|^)```/);
const blocks: Block[] = [];
for (const part of parts) {