fix: Webview JS crash on formatting due to unescaped newline (v1.0.28)

This commit is contained in:
Jay
2026-04-13 15:54:24 +09:00
parent df66c18ff7
commit cfdf8036c7
2 changed files with 2 additions and 2 deletions
+1 -1
View File
@@ -1016,7 +1016,7 @@ function fmt(t){
if(t.lastIndexOf('<create_file') > t.lastIndexOf('</create_file>')) t += '</create_file>';
if(t.lastIndexOf('<edit_file') > t.lastIndexOf('</edit_file>')) t += '</edit_file>';
if(t.lastIndexOf('<run_command') > t.lastIndexOf('</run_command>')) t += '</run_command>';
if((t.match(/\x60\x60\x60/g)||[]).length % 2 !== 0) t += '\n\x60\x60\x60';
if((t.match(/\x60\x60\x60/g)||[]).length % 2 !== 0) t += '\\n\x60\x60\x60';
const blocks = [];
function pushB(h){ blocks.push(h); return '__B' + (blocks.length-1) + '__'; }