From e0b778850e1e3210efe57d51f7953c5194080d65 Mon Sep 17 00:00:00 2001
From: Concedo
Date: Fri, 6 Oct 2023 15:43:22 +0800
Subject: [PATCH] do not use fancy quotes in codeblocks
---
index.html | 13 +++++++++----
1 file changed, 9 insertions(+), 4 deletions(-)
diff --git a/index.html b/index.html
index 275260f..27dc6c3 100644
--- a/index.html
+++ b/index.html
@@ -5,8 +5,8 @@
It requires no dependencies, installation or setup.
Just copy this single static HTML file anywhere and open it in a browser, or from a webserver.
Please go to https://github.com/LostRuins/lite.koboldai.net for updates on Kobold Lite.
-Kobold Lite is under the AGPL v3.0 License for the purposes of koboldcpp. Please do not remove this line.
-Current version: 75
+Kobold Lite is under the AGPL v3.0 License unless otherwise exempted. Please do not remove this line.
+Current version: 76
-Concedo
-->
@@ -9595,8 +9595,13 @@
function applyStylizedCodeBlocks() {
let blocks = newbodystr.split(/(```[\s\S]*?\n[\s\S]*?```)/g);
for (var i = 0; i < blocks.length; i++) {
- if (blocks[i].startsWith('```')) { blocks[i] = blocks[i].replace(/```[\s\S]*?\n([\s\S]*?)```/g, `
$1
`); }
- else { blocks[i] = blocks[i].replaceAll('```','`').replaceAll('``','`').replace(/`(.*?)`/g, `$1
`); }
+ if (blocks[i].startsWith('```')) {
+ blocks[i] = blocks[i].replace(/```[\s\S]*?\n([\s\S]*?)```/g,
+ function (m,m2) {return `
${m2.replace(/[“”]/g, "\"")}
`});
+ }
+ else {
+ blocks[i] = blocks[i].replaceAll('```', '`').replaceAll('``', '`').replace(/`(.*?)`/g, function (m,m2) {return `${m2.replace(/[“”]/g, "\"")}
`;}); //remove fancy quotes too
+ }
}
return blocks.join('');
}