From 456ae3cc1199f8661a9d230db38076ef315a7cb1 Mon Sep 17 00:00:00 2001 From: Antti Akonniemi Date: Sun, 10 May 2026 21:48:51 +0300 Subject: [PATCH] Fix nested ::: container rendering (issue #66) --- src/parser/remark-containers.ts | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/parser/remark-containers.ts b/src/parser/remark-containers.ts index ce369562..2099cf0c 100644 --- a/src/parser/remark-containers.ts +++ b/src/parser/remark-containers.ts @@ -177,8 +177,11 @@ export const remarkWiremdContainers: Plugin = () => { for (const line of lines) { const trimmed = line.trim(); if (trimmed === ':::') { - foundClosing = true; - break; + nestingLevel--; + if (nestingLevel === 0) { + foundClosing = true; + break; + } } else if (trimmed.startsWith(':::')) { // Check if this is a new container start (has content after :::) const afterMarker = trimmed.substring(3).trim();