diff --git a/src/cli/inline-blocks.ts b/src/cli/inline-blocks.ts index 98756ec..5e6dc7b 100644 --- a/src/cli/inline-blocks.ts +++ b/src/cli/inline-blocks.ts @@ -70,6 +70,11 @@ export function extractInlineBlocks( (_match: string, lang: string, infoString: string, body: string) => { const attrs = parseAttrs(infoString); + // Only process blocks that have `file` or `as`; leave others untouched + if (!attrs.file && !attrs.as) { + return _match; + } + // Determine filename: explicit `file` or content-hash generated const filename = attrs.file || `_inline_${contentHash(body)}.${lang || "txt"}`; @@ -94,7 +99,7 @@ export function extractInlineBlocks( return `:${attrs.as}[./${filename}]${extraStr}`; } - return ""; // no `as` — strip the block entirely + return ""; // has `file` but no `as` — strip the block (body is already injected into index) }, ); }