This commit is contained in:
Timothy Jaeryang Baek
2026-04-13 21:52:19 -05:00
parent 9a8c4da67d
commit 45e49d33e5
5 changed files with 19 additions and 4 deletions
+12 -1
View File
@@ -923,8 +923,19 @@ export const processDetails = (content) => {
attributes[attributeMatch[1]] = attributeMatch[2];
}
// New format: result in body content; Old format: result in attribute
let resultText = '';
if (attributes.result) {
content = content.replace(match, unescapeHtml(attributes.result));
resultText = unescapeHtml(attributes.result);
} else {
// Extract body content (strip <summary>...</summary>)
const bodyMatch = match.match(/<summary>[\s\S]*?<\/summary>\s*([\s\S]*?)\s*<\/details>/i);
if (bodyMatch && bodyMatch[1].trim()) {
resultText = unescapeHtml(bodyMatch[1].trim());
}
}
if (resultText) {
content = content.replace(match, resultText);
}
}
}
+1 -1
View File
@@ -60,7 +60,7 @@ function detailsTokenizer(src: string) {
}
function detailsStart(src: string) {
return src.match(/^<details>/) ? 0 : -1;
return src.match(/^<details[\s>]/) ? 0 : -1;
}
function detailsRenderer(token: any) {