mirror of
https://github.com/naturalcrit/homebrewery.git
synced 2025-12-29 15:32:40 +00:00
Remove need for Definition exceptios
Retool original `:` break to insert `\n\n`s between each `:` so that the definition lists never have a chance for a mismatch. Rename token to "hardbreak" Add tests for hardBreaks for `:`, `::`, and `:::` which should verify it works and does not collide with definitionlists.
This commit is contained in:
23
tests/markdown/hardbreaks.test.js
Normal file
23
tests/markdown/hardbreaks.test.js
Normal file
@@ -0,0 +1,23 @@
|
||||
/* eslint-disable max-lines */
|
||||
|
||||
const Markdown = require('naturalcrit/markdown.js');
|
||||
|
||||
describe('Hard Breaks', ()=>{
|
||||
test('Single Break', function() {
|
||||
const source = ':\n\n';
|
||||
const rendered = Markdown.render(source).trim();
|
||||
expect(rendered, `Input:\n${source}`, { showPrefix: false }).toBe('<div class=\'blank\'></div>');
|
||||
});
|
||||
|
||||
test('Double Break', function() {
|
||||
const source = '::\n\n';
|
||||
const rendered = Markdown.render(source).trim();
|
||||
expect(rendered, `Input:\n${source}`, { showPrefix: false }).toBe('<div class=\'blank\'></div>\n<div class=\'blank\'></div>');
|
||||
});
|
||||
|
||||
test('Triple Break', function() {
|
||||
const source = ':::\n\n';
|
||||
const rendered = Markdown.render(source).trim();
|
||||
expect(rendered, `Input:\n${source}`, { showPrefix: false }).toBe('<div class=\'blank\'></div>\n<div class=\'blank\'></div>\n<div class=\'blank\'></div>');
|
||||
});
|
||||
});
|
||||
Reference in New Issue
Block a user