diff --git a/packages/nuemark/src/parse.js b/packages/nuemark/src/parse.js index 84425e4f..226fea36 100644 --- a/packages/nuemark/src/parse.js +++ b/packages/nuemark/src/parse.js @@ -170,10 +170,10 @@ 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)) + if (line[0] == '[' && line.slice(-1) == ']' && !line.includes('][')) { + comp = parseComponent(line.slice(1, -1)) blocks.push(comp) md = null diff --git a/packages/nuemark/test/nuemark.test.js b/packages/nuemark/test/nuemark.test.js index 56ab6a92..01be0eeb 100644 --- a/packages/nuemark/test/nuemark.test.js +++ b/packages/nuemark/test/nuemark.test.js @@ -119,12 +119,12 @@ test('[tabs] key and wrapper', () => { const NESTED_TABS = ` - [tabs "Foo | Bar"] +[tabs "Foo | Bar"] First --- Second - [tabs "Baz | Bruh" key="inner"]\t + [tabs "Baz | Bruh" key="inner"] Inner 1 --- Inner 2