ausername-12345 commited on
Commit ·
94c6419
1
Parent(s): ef34f59
match read/write inside any code block language tag
Browse files- src/agent.js +2 -2
src/agent.js
CHANGED
|
@@ -64,7 +64,7 @@ function processFileActions(content) {
|
|
| 64 |
const actions = [];
|
| 65 |
let text = content;
|
| 66 |
|
| 67 |
-
const readRe = /(?:```
|
| 68 |
let m;
|
| 69 |
while ((m = readRe.exec(content)) !== null) {
|
| 70 |
const filePath = m[1].trim();
|
|
@@ -81,7 +81,7 @@ function processFileActions(content) {
|
|
| 81 |
}
|
| 82 |
text = text.replace(readRe, '');
|
| 83 |
|
| 84 |
-
const writeRe = /```write\s+([^\n`]+)\n([\s\S]*?)```/g;
|
| 85 |
while ((m = writeRe.exec(content)) !== null) {
|
| 86 |
const filePath = m[1].trim();
|
| 87 |
const fileContent = m[2];
|
|
|
|
| 64 |
const actions = [];
|
| 65 |
let text = content;
|
| 66 |
|
| 67 |
+
const readRe = /(?:```\w*\n)?read\s+([^\n`]+)/g;
|
| 68 |
let m;
|
| 69 |
while ((m = readRe.exec(content)) !== null) {
|
| 70 |
const filePath = m[1].trim();
|
|
|
|
| 81 |
}
|
| 82 |
text = text.replace(readRe, '');
|
| 83 |
|
| 84 |
+
const writeRe = /```(?:\w*\n)?write\s+([^\n`]+)\n([\s\S]*?)```/g;
|
| 85 |
while ((m = writeRe.exec(content)) !== null) {
|
| 86 |
const filePath = m[1].trim();
|
| 87 |
const fileContent = m[2];
|