diff --git a/src/content/knowledgebase/tool-misp.md b/src/content/knowledgebase/tool-misp.md index fe4815d..8f1a74b 100644 --- a/src/content/knowledgebase/tool-misp.md +++ b/src/content/knowledgebase/tool-misp.md @@ -18,6 +18,9 @@ sections: review_status: "published" --- +![MinIO Demo](https://console.s3.cc24.dev/browser/forensic-pathways/20250610_AllgemeineForensikII_Vorlesung.mp4 "MinIO Playback") + + > **⚠️ Hinweis**: Dies ist ein vorläufiger, KI-generierter Knowledgebase-Eintrag. Wir freuen uns über Verbesserungen und Ergänzungen durch die Community! diff --git a/src/utils/remarkVideoPlugin.ts b/src/utils/remarkVideoPlugin.ts index dfd2d02..d5b2670 100644 --- a/src/utils/remarkVideoPlugin.ts +++ b/src/utils/remarkVideoPlugin.ts @@ -24,6 +24,7 @@ interface VideoConfig { * 3. HTML video tags: * 4. Link syntax with video: [Video Title](url.mp4) */ +// REPLACE the transformer body to collect async tasks and call the processor export const remarkVideoPlugin: Plugin<[VideoConfig?], Root> = (config = {}) => { const { enableAsync = true, @@ -37,84 +38,75 @@ export const remarkVideoPlugin: Plugin<[VideoConfig?], Root> = (config = {}) => } = config; return async (tree: Root) => { - const videoNodes: Array<{ node: any; parent: any; index: number; replacement: any }> = []; + const tasks: Array> = []; - // Find video directives (:::video{...}) + // :::video{...} visit(tree, 'textDirective', (node: any, index: number | undefined, parent: any) => { if (node.name === 'video' && typeof index === 'number') { - const videoNode = processVideoDirective(node, defaultOptions); - if (videoNode) { - videoNodes.push({ node, parent, index, replacement: videoNode }); - } + tasks.push((async () => { + const replacement = await processVideoDirectiveAsync(node, defaultOptions); + if (replacement && parent?.children) parent.children[index] = replacement; + })()); } }); - // Find container directives (:::video ... :::) + // :::video ... ::: visit(tree, 'containerDirective', (node: any, index: number | undefined, parent: any) => { if (node.name === 'video' && typeof index === 'number') { - const videoNode = processVideoDirective(node, defaultOptions); - if (videoNode) { - videoNodes.push({ node, parent, index, replacement: videoNode }); - } + tasks.push((async () => { + const replacement = await processVideoDirectiveAsync(node, defaultOptions); + if (replacement && parent?.children) parent.children[index] = replacement; + })()); } }); - // Find image nodes that might be videos + // ![alt](video.mp4 "title") visit(tree, 'image', (node: any, index: number | undefined, parent: any) => { if (isVideoUrl(node.url) && typeof index === 'number') { - const videoNode = processImageAsVideo(node, defaultOptions); - if (videoNode) { - videoNodes.push({ node, parent, index, replacement: videoNode }); - } + tasks.push((async () => { + const replacement = await processImageAsVideoAsync(node, defaultOptions); + if (replacement && parent?.children) parent.children[index] = replacement; + })()); } }); - // Find link nodes that point to videos + // [Title](video.mp4) visit(tree, 'link', (node: any, index: number | undefined, parent: any) => { if (isVideoUrl(node.url) && typeof index === 'number') { - const videoNode = processLinkAsVideo(node, defaultOptions); - if (videoNode) { - videoNodes.push({ node, parent, index, replacement: videoNode }); - } + tasks.push((async () => { + const replacement = await processLinkAsVideoAsync(node, defaultOptions); + if (replacement && parent?.children) parent.children[index] = replacement; + })()); } }); - // Process HTML video tags in the tree + // Raw