Skip to content

Commit

Permalink
fix: insert newlines before images
Browse files Browse the repository at this point in the history
  • Loading branch information
kellyjosephprice committed Nov 7, 2023
1 parent 05be87a commit 58f9396
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
1 change: 1 addition & 0 deletions __tests__/flavored-compilers/magic-blocks.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ describe('Compile Magic Blocks', () => {
expect(compiled).toMatchInlineSnapshot(`
"> 👍 It works!
>
>
> [block:image]{\\"images\\":[{\\"image\\":[\\"https://owlbertsio-resized.s3.amazonaws.com/This-Is-Fine.jpg.full.png\\",\\"\\",\\"\\"],\\"align\\":\\"center\\"}]}[/block]
"
`);
Expand Down
2 changes: 1 addition & 1 deletion processor/compile/magic-block.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
const magicBlock = (type, data, parent) => {
return parent.type === 'root'
? `[block:${type}]\n${JSON.stringify(data, null, 2)}\n[/block]\n`
: `[block:${type}]${JSON.stringify(data)}[/block]`;
: `\n[block:${type}]${JSON.stringify(data)}[/block]`;
};

export default magicBlock;

0 comments on commit 58f9396

Please sign in to comment.