mirror of
https://gitlab.com/soapbox-pub/shakespeare.git
synced 2026-12-05 16:23:36 +00:00
ReadWebpageTool: fix newlines in codeblocks
This commit is contained in:
2 files changed
+9
-9
No files matched your search
@@ -39,7 +39,7 @@ export class ReadWebpageTool implements Tool<ReadWebpageParams> {
|
||||
const codeElement = node.querySelector("code");
|
||||
if (codeElement) {
|
||||
const language = codeElement.className.match(/language-(\w+)/)?.[1] || "";
|
||||
return `\n\n\`\`\`${language}\n${codeElement.textContent || content}\n\`\`\`\n\n`;
|
||||
return `\n\n\`\`\`${language}\n${content}\n\`\`\`\n\n`;
|
||||
}
|
||||
return `\n\n\`\`\`\n${content}\n\`\`\`\n\n`;
|
||||
},
|
||||
|
||||
Reference in new issue
Block a user