Skip to content

Commit

Permalink
fix: block
Browse files Browse the repository at this point in the history
  • Loading branch information
nobkd committed Sep 19, 2024
1 parent 1ba1b7a commit e15bff2
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions packages/nuemark/src/parse.js
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand All @@ -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
Expand Down

0 comments on commit e15bff2

Please sign in to comment.