This include the chat code as before, while the image is the version I'm working on.
formatText in the included file cause text to dissappear and should be replaced by something like this:
function formatText(text) {
text = text.replace(/&/g, '&').replace(/</g, '<').replace(/>/g, '>');
text = text.replace(/^#\s+(.*?)\s*$/gm, '<h1>$1</h1>');
text = text.replace(/^##\s+(.*?)\s*$/gm, '<h2>$1</h2>');
text = text.replace(/^###\s+(.*?)\s*$/gm, '<h3>$1</h3>');
text = text.replace(/\*\*\*(.*?)\*\*\*/g, '<strong><em>$1</em></strong>');
text = text.replace(/\*\*(.*?)\*\*/g, '<strong>$1</strong>');
text = text.replace(/\*(?!\/)(.*?)(?<!\/)\*/g, '<em>$1</em>');
text = text.replace(/~~(.*?)~~/g, '<s>$1</s>');
text = text.replace(/```([\s\S]*?)```/g, '<pre>$1</pre>');
text = text.replace(/^\-\s+(.*?)$/gm, '<ul><li>$1</li></ul>');
text = text.replace(/^\d+\.\s+(.*?)$/gm, '<ol><li>$1</li></ol>');
text = text.replace(/\n/g, '<br>');
text = text.replace(/ /g, ' ');
return text;
}
Ai tools have a tendency to have strenghts and weeknesses... and when/what they forget after a while, depending on the AI-model-provider.
Mistral is good with look and feel, but haven't figured out some of the finer rexx and html features, while google gemini create awful/ugly ui and can drop everything (code, variables) without notice.