Automatically unfold details

This commit is contained in:
√(noham)²
2026-06-20 17:59:24 +02:00
parent 5ce76ffea6
commit 9fba22ca6c

View File

@@ -34,6 +34,7 @@ export function enhanceHtml (html, customCss, highlightStyle = 'github') {
'</head>', '</head>',
`${highlightCss(highlightStyle)}${HIGHLIGHT_JS}</head>` `${highlightCss(highlightStyle)}${HIGHLIGHT_JS}</head>`
) )
enhanced = enhanced.replace(/<details(?![^>]*?\bopen\b)/g, '<details open')
if (customCss !== null) { if (customCss !== null) {
enhanced = enhanced.replace( enhanced = enhanced.replace(
'</head>', '</head>',