Spaces:
Sleeping
Sleeping
Update index.html
Browse files- index.html +22 -7
index.html
CHANGED
|
@@ -299,15 +299,30 @@
|
|
| 299 |
const steps = data.steps.split('\n').filter(line => line.trim() !== "");
|
| 300 |
steps.forEach((step, index) => {
|
| 301 |
const stepElement = document.createElement('div');
|
| 302 |
-
stepElement.className = 'step-highlight p-4 rounded-lg';
|
| 303 |
-
|
| 304 |
-
|
| 305 |
-
|
| 306 |
-
|
| 307 |
-
|
| 308 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 309 |
stepsContainer.appendChild(stepElement);
|
| 310 |
});
|
|
|
|
| 311 |
|
| 312 |
finalAnswer.innerHTML = data.final_answer;
|
| 313 |
if (window.renderMathInElement) {
|
|
|
|
| 299 |
const steps = data.steps.split('\n').filter(line => line.trim() !== "");
|
| 300 |
steps.forEach((step, index) => {
|
| 301 |
const stepElement = document.createElement('div');
|
| 302 |
+
stepElement.className = 'step-highlight p-4 rounded-lg flex';
|
| 303 |
+
|
| 304 |
+
const numberBadge = document.createElement('span');
|
| 305 |
+
numberBadge.className = 'flex-shrink-0 bg-purple-600 text-white rounded-full w-6 h-6 flex items-center justify-center mr-3';
|
| 306 |
+
numberBadge.textContent = index + 1;
|
| 307 |
+
|
| 308 |
+
const content = document.createElement('div');
|
| 309 |
+
content.innerHTML = step;
|
| 310 |
+
|
| 311 |
+
// 🧠 Automatically render LaTeX inside the step
|
| 312 |
+
if (window.renderMathInElement) {
|
| 313 |
+
renderMathInElement(content, {
|
| 314 |
+
delimiters: [
|
| 315 |
+
{left: '$$', right: '$$', display: true},
|
| 316 |
+
{left: '$', right: '$', display: false}
|
| 317 |
+
]
|
| 318 |
+
});
|
| 319 |
+
}
|
| 320 |
+
|
| 321 |
+
stepElement.appendChild(numberBadge);
|
| 322 |
+
stepElement.appendChild(content);
|
| 323 |
stepsContainer.appendChild(stepElement);
|
| 324 |
});
|
| 325 |
+
|
| 326 |
|
| 327 |
finalAnswer.innerHTML = data.final_answer;
|
| 328 |
if (window.renderMathInElement) {
|