diff --git a/packages/nuemark/src/parse.js b/packages/nuemark/src/parse.js index 84425e4f..d68c69a2 100644 --- a/packages/nuemark/src/parse.js +++ b/packages/nuemark/src/parse.js @@ -170,15 +170,9 @@ export function parseBlocks(lines) { // code line if (fenced) return fenced.content.push(line) - // component const trimmed = line.trim() - if (!comp && trimmed[0] == '[' && trimmed.slice(-1) == ']' && !line.includes('][')) { - comp = parseComponent(trimmed.slice(1, -1)) - blocks.push(comp) - md = null - // component args - } else if (comp) { + if (comp) { const next = getNext(lines, i) const indent = getIndent(next) @@ -190,6 +184,12 @@ export function parseBlocks(lines) { if (!line.trimStart()) comp.body?.push(line) else if (!getIndent(line)) comp = null + + // component + } else if (trimmed[0] == '[' && trimmed.slice(-1) == ']' && !line.includes('][')) { + comp = parseComponent(trimmed.slice(1, -1)) + blocks.push(comp) + md = null } // markdown