Spaces:
Sleeping
Sleeping
Update web/src/components/Message.tsx
Browse files- web/src/components/Message.tsx +16 -16
web/src/components/Message.tsx
CHANGED
|
@@ -208,24 +208,28 @@ export function Message({
|
|
| 208 |
</ul>
|
| 209 |
),
|
| 210 |
|
|
|
|
| 211 |
/* ---------- Ordered list (1. 2. 3.) ---------- */
|
| 212 |
ol: ({ children }) => (
|
| 213 |
-
<ol className="my-3
|
| 214 |
{children}
|
| 215 |
</ol>
|
| 216 |
),
|
| 217 |
-
|
| 218 |
li: ({ children, node }) => {
|
| 219 |
const parent = (node as any)?.parent?.tagName;
|
| 220 |
-
|
| 221 |
-
// ——
|
| 222 |
-
if (parent === "
|
| 223 |
return (
|
| 224 |
<li className="list-none">
|
| 225 |
-
<div className="flex items-start
|
| 226 |
-
{/*
|
| 227 |
-
<span className="
|
| 228 |
-
|
|
|
|
|
|
|
|
|
|
| 229 |
<div className="min-w-0">
|
| 230 |
{children}
|
| 231 |
</div>
|
|
@@ -233,13 +237,9 @@ export function Message({
|
|
| 233 |
</li>
|
| 234 |
);
|
| 235 |
}
|
| 236 |
-
|
| 237 |
-
|
| 238 |
-
return
|
| 239 |
-
<li className="pl-1">
|
| 240 |
-
{children}
|
| 241 |
-
</li>
|
| 242 |
-
);
|
| 243 |
},
|
| 244 |
|
| 245 |
strong: ({ children }) => (
|
|
|
|
| 208 |
</ul>
|
| 209 |
),
|
| 210 |
|
| 211 |
+
/* ---------- Ordered list (1. 2. 3.) ---------- */
|
| 212 |
/* ---------- Ordered list (1. 2. 3.) ---------- */
|
| 213 |
ol: ({ children }) => (
|
| 214 |
+
<ol className="my-3 space-y-4">
|
| 215 |
{children}
|
| 216 |
</ol>
|
| 217 |
),
|
| 218 |
+
|
| 219 |
li: ({ children, node }) => {
|
| 220 |
const parent = (node as any)?.parent?.tagName;
|
| 221 |
+
|
| 222 |
+
// —— ordered list: number aligned left, text indented
|
| 223 |
+
if (parent === "ol") {
|
| 224 |
return (
|
| 225 |
<li className="list-none">
|
| 226 |
+
<div className="flex items-start">
|
| 227 |
+
{/* number column */}
|
| 228 |
+
<span className="w-6 text-right pr-2 flex-shrink-0 font-medium">
|
| 229 |
+
{(node as any)?.index + 1}.
|
| 230 |
+
</span>
|
| 231 |
+
|
| 232 |
+
{/* content column */}
|
| 233 |
<div className="min-w-0">
|
| 234 |
{children}
|
| 235 |
</div>
|
|
|
|
| 237 |
</li>
|
| 238 |
);
|
| 239 |
}
|
| 240 |
+
|
| 241 |
+
/* fallback (unordered handled elsewhere) */
|
| 242 |
+
return <li>{children}</li>;
|
|
|
|
|
|
|
|
|
|
|
|
|
| 243 |
},
|
| 244 |
|
| 245 |
strong: ({ children }) => (
|