From c63b6ffaf0857ef5f9a28e9a070a91133b33ed79 Mon Sep 17 00:00:00 2001 From: David Bolack Date: Tue, 17 Dec 2024 21:38:32 -0600 Subject: [PATCH] Add test for a pair of inline horizontal breaks --- shared/naturalcrit/markdown.js | 2 +- tests/markdown/horizontalSpaces.test.js | 6 ++++++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/shared/naturalcrit/markdown.js b/shared/naturalcrit/markdown.js index 6ceee2b03..6b737e02f 100644 --- a/shared/naturalcrit/markdown.js +++ b/shared/naturalcrit/markdown.js @@ -408,7 +408,7 @@ const nonbreakingSpaces = { } }, renderer(token) { - return ` `.repeat(token.length).concat('\n'); + return ` `.repeat(token.length).concat(''); } }; diff --git a/tests/markdown/horizontalSpaces.test.js b/tests/markdown/horizontalSpaces.test.js index 6789b934c..1ef8ea043 100644 --- a/tests/markdown/horizontalSpaces.test.js +++ b/tests/markdown/horizontalSpaces.test.js @@ -33,6 +33,12 @@ describe('Hard Breaks', ()=>{ expect(rendered, `Input:\n${source}`, { showPrefix: false }).toBe(`

   \n\n   \n\n   \n

`); }); + test('Pair of inline Breaks', function() { + const source = ':>>:>>'; + const rendered = Markdown.render(source).trim(); + expect(rendered, `Input:\n${source}`, { showPrefix: false }).toBe(`

  \n  \n

`); + }); + test('Break directly between two paragraphs', function() { const source = 'Line 1\n:>>\nLine 2'; const rendered = Markdown.render(source).trim();