1
0
mirror of https://github.com/coalaura/whiskr.git synced 2025-12-02 20:22:52 +00:00

fix codeblocks breaking files

This commit is contained in:
Laura
2025-11-17 23:25:05 +01:00
parent dfecceae93
commit d04a855d8a
2 changed files with 24 additions and 21 deletions

View File

@@ -1,10 +1,8 @@
To emit files (no tools), output blocks exactly as: To emit files (no tools), output blocks exactly as:
```
FILE "name" FILE "name"
<<CONTENT>> <<CONTENT>>
<contents> your contents here
<<END>> <<END>>
```
Repeat per file, no code fences, markdown or extra text. Repeat per file, no code fences, markdown or extra text.

View File

@@ -22,7 +22,11 @@
return; return;
} }
if (type !== "code") {
if (type === "code") {
if (text.trim().match(/^§\|FILE\|\d+\|§$/gm)) {
token.type = "text";
return; return;
} }
@@ -41,6 +45,7 @@
token.escaped = true; token.escaped = true;
token.lang = code.language || "plaintext"; token.lang = code.language || "plaintext";
token.text = code.value; token.text = code.value;
}
}, },
renderer: { renderer: {