Merge branch 'main' of https://gitee.com/CakeCN/code-agent
This commit is contained in:
@@ -725,6 +725,10 @@ function sanitizeHeadingsBeyondFirst(text = "") {
|
||||
|
||||
// PUT 请求保存更新
|
||||
try {
|
||||
console.log("saveToOrigin", CURRENT.links.lesson, CURRENT.links.prompt, CURRENT.links.score);
|
||||
console.log("updatedLesson", updatedLesson);
|
||||
console.log("updatedPrompt", updatedPrompt);
|
||||
console.log("updatedScore", updatedScore);
|
||||
const result = await saveToOrigin({
|
||||
lesson: { cdn_link: CURRENT.links.lesson, content: updatedLesson },
|
||||
prompt: { cdn_link: CURRENT.links.prompt, content: updatedPrompt },
|
||||
@@ -771,6 +775,11 @@ function sanitizeHeadingsBeyondFirst(text = "") {
|
||||
|
||||
// 替换该步骤内容
|
||||
const lines = [...parsed.lines];
|
||||
console.log("lines length", lines.length);
|
||||
console.log("startLine", startLine);
|
||||
console.log("endLine", endLine);
|
||||
console.log("endLine - startLine + 1", endLine - startLine + 1);
|
||||
console.log("newContent", newContent);
|
||||
lines.splice(startLine, endLine - startLine + 1, newContent); // 用新内容替换
|
||||
|
||||
return lines.join('\n'); // 返回更新后的完整内容
|
||||
|
||||
Reference in New Issue
Block a user