0
0
mirror of https://github.com/naturalcrit/homebrewery.git synced 2025-12-24 18:32:41 +00:00

Add test for a pair of inline horizontal breaks

This commit is contained in:
David Bolack
2024-12-17 21:38:32 -06:00
parent 0c90d1a14d
commit c63b6ffaf0
2 changed files with 7 additions and 1 deletions

View File

@@ -408,7 +408,7 @@ const nonbreakingSpaces = {
}
},
renderer(token) {
return ` `.repeat(token.length).concat('\n');
return ` `.repeat(token.length).concat('');
}
};

View File

@@ -33,6 +33,12 @@ describe('Hard Breaks', ()=>{
expect(rendered, `Input:\n${source}`, { showPrefix: false }).toBe(`<p>&nbsp;&nbsp;&nbsp;\n\n&nbsp;&nbsp;&nbsp;\n\n&nbsp;&nbsp;&nbsp;\n</p>`);
});
test('Pair of inline Breaks', function() {
const source = ':>>:>>';
const rendered = Markdown.render(source).trim();
expect(rendered, `Input:\n${source}`, { showPrefix: false }).toBe(`<p>&nbsp;&nbsp;\n&nbsp;&nbsp;\n</p>`);
});
test('Break directly between two paragraphs', function() {
const source = 'Line 1\n:>>\nLine 2';
const rendered = Markdown.render(source).trim();