fix: Krea-Tags in Code-Blöcken nicht parsen, Git-Verhalten unabhängig von ToolChoice
- renderMarkdown: Code-Blöcke (<pre>, <code>) vor Krea-Regex schützen via Platzhalter-Swap, danach wiederherstellen - SystemPromptBuilder: Git-Commit-Regeln nur an Workspace gebunden, nicht mehr an ToolChoice:any – eigener PromptBlock mit Label - CSS: modal-width Variable, Krea-Modal width:max-content, minor tweaks - TODO.md aktualisiert
This commit is contained in:
1 parent
4bf500ad47
commit
754b2aa3e3
6 files changed
+53
-21
No files matched your search
@@ -11,6 +11,12 @@ marked.setOptions({ breaks: true, gfm: true });
|
||||
function renderMarkdown(text) {
|
||||
if (!text) return '';
|
||||
var html = marked.parse(text.trim());
|
||||
// Code-Blöcke (<pre>...<code>...</code>...</pre> und inline <code>...</code>) schützen
|
||||
var codeBlocks = [];
|
||||
html = html.replace(/<pre[\s>][\s\S]*?<\/pre>|<code[\s>][\s\S]*?<\/code>/gi, function(m) {
|
||||
codeBlocks.push(m);
|
||||
return '%%CODE' + (codeBlocks.length - 1) + '%%';
|
||||
});
|
||||
// [Krea: dateiname.png] → Inline-Thumbnail mit Klick für Vollbild
|
||||
html = html.replace(/\[Krea:\s*([^\]]+)\]/g, function(match, filename) {
|
||||
var fn = filename.trim();
|
||||
@@ -21,6 +27,10 @@ function renderMarkdown(text) {
|
||||
+ '<img class="krea-thumb" src="' + thumbUrl + '" alt="' + safeFn + '" loading="lazy">'
|
||||
+ '</span>';
|
||||
});
|
||||
// Code-Blöcke wiederherstellen
|
||||
html = html.replace(/%%CODE(\d+)%%/g, function(m, idx) {
|
||||
return codeBlocks[parseInt(idx)];
|
||||
});
|
||||
return html;
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user