         messageDiv.classList.add("mt-3", "p-3", "rounded");
            messageDiv.classList.add("bot-message");
           
            const content = data.content;
            
            // Check if the content has code block
            const hasCodeBlock = content.includes("```");
            if (hasCodeBlock) {
              // If the content has code block, wrap it in a <pre><code> element
              const codeContent = content.replace(/```([\s\S]+?)```/g, '</p><pre><code>$1</code></pr