From 5575dc020a41a722d3f5f8be33968af19e02b246 Mon Sep 17 00:00:00 2001 From: nobkd <44443899+nobkd@users.noreply.github.com> Date: Wed, 18 Sep 2024 15:25:55 +0200 Subject: [PATCH] Revert "fix: space around block md ext" --- packages/nuemark/src/parse.js | 6 +++--- packages/nuemark/test/nuemark.test.js | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) 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